View previous topic :: View next topic
|
Author |
Message |
hikaps14
Active User
Joined: 02 Sep 2005 Posts: 189 Location: Noida
|
|
|
|
hi ,
can ne tell me wat will be the effect of querry 1 on querry 2
Querry 1:
CREATE TABLE table1(col1 INT, col2 INT)
INSERT INTO table1 VALUES (2,2)
INSERT INTO table1 VALUES (323,2)
ROLLBACK
Querr 2:
wht is result for Select * from table1
i mean will there be a table created or not .
or will there be any other effect .
can ne body give me a clear idea regarding the result of Querry 2
Thanks in advance ,
-Kapil . |
|
Back to top |
|
|
DavidatK
Active Member
Joined: 22 Nov 2005 Posts: 700 Location: Troy, Michigan USA
|
|
|
|
Kapil,
What happend when you run this?
Methinks you'll get 'TABLE1 is an unidentified name' The rollback rolled it right out of existence.
Dave |
|
Back to top |
|
|
cheryala
New User
Joined: 20 Mar 2006 Posts: 46
|
|
|
|
Hi,
Unless and untill you issue a commit after creating table ..the insert statements won't get executed.
Cheers
Cheryala |
|
Back to top |
|
|
shrivatsa Warnings : 1 Active User
Joined: 17 Mar 2006 Posts: 174 Location: Bangalore
|
|
|
|
Hi Kapil,
what david told is correct.
cheryala the insert statement will get executed.
here is the log for your info
CREATE TABLE TABLE1(COL1 INT, COL2 INT);
---------+---------+---------+---------+---------+---------+---
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 0
---------+---------+---------+---------+---------+---------+---
INSERT INTO TABLE1 VALUES (2,2);
---------+---------+---------+---------+---------+---------+---
DSNE615I NUMBER OF ROWS AFFECTED IS 1
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 0
---------+---------+---------+---------+---------+---------+---
INSERT INTO TABLE1 VALUES (323,2);
---------+---------+---------+---------+---------+---------+---
DSNE615I NUMBER OF ROWS AFFECTED IS 1
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 0
---------+---------+---------+---------+---------+---------+---
ROLLBACK;
---------+---------+---------+---------+---------+---------+---
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 0
---------+---------+---------+---------+---------+---------+---
---------+---------+---------+---------+---------+---------+---
DSNE617I COMMIT PERFORMED, SQLCODE IS 0
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 0
---------+---------+---------+---------+---------+---------+---
DSNE601I SQL STATEMENTS ASSUMED TO BE BETWEEN COLUMNS 1 AND 72
DSNE620I NUMBER OF SQL STATEMENTS PROCESSED IS 4
and for second query
SELECT * FROM TABLE1;
---------+---------+---------+---------+---------+---------+--------
DSNT408I SQLCODE = -204, ERROR: xxxxxx.TABLE1 IS AN UNDEFINED
NAME
Please correct me if I am wrong
Thanks
Shri |
|
Back to top |
|
|
|