IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Rollback Querry


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
hikaps14

Active User


Joined: 02 Sep 2005
Posts: 189
Location: Noida

PostPosted: Wed May 03, 2006 5:35 pm
Reply with quote

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
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Thu May 04, 2006 3:34 am
Reply with quote

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
View user's profile Send private message
cheryala

New User


Joined: 20 Mar 2006
Posts: 46

PostPosted: Fri May 05, 2006 12:38 pm
Reply with quote

Hi,
Unless and untill you issue a commit after creating table ..the insert statements won't get executed.
Cheers
Cheryala
Back to top
View user's profile Send private message
shrivatsa
Warnings : 1

Active User


Joined: 17 Mar 2006
Posts: 174
Location: Bangalore

PostPosted: Fri May 05, 2006 1:14 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts filter COMMIT/ROLLBACK statements DFSORT/ICETOOL 13
No new posts to extract node name from XML via DB2... DB2 3
No new posts TWA variable having junk value after ... CICS 1
No new posts Handle ROLLBACK in EXCI interface CICS 12
No new posts Rollback does not remove messages? Java & MQSeries 5
Search our Forums:

Back to Top