Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
How to set Auto Commit turned off in DB2 stored proceudre.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
Munish Singla

New User


Joined: 18 Jul 2007
Posts: 21
Location: kolkata

PostPosted: Thu Jan 15, 2009 7:15 am    Post subject: How to set Auto Commit turned off in DB2 stored proceudre.
Reply with quote

Hi,

I want to turn off Auto Commit option in DB2 stored procedure turned off.
Could you please help in doing this.

Thanks,

Munish
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Jan 15, 2009 7:29 am    Post subject:
Reply with quote

Hello,

Is this what you are looking for (commit on return)?

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/handheld/Connected/BOOKS/dsnsqj10/5.34?
Back to top
View user's profile Send private message
Munish Singla

New User


Joined: 18 Jul 2007
Posts: 21
Location: kolkata

PostPosted: Thu Jan 15, 2009 11:07 pm    Post subject:
Reply with quote

Thanks for your reply.

My requirement is I don't want any SQL statement to auto commit inside stored procedure. I want the commit the whole SP after successful operation of each SQL otherwise I need to rollback it.

So is there any statement through which we can set AutoCommit option to false explicitly.

Thanks,
Munish
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Jan 15, 2009 11:46 pm    Post subject:
Reply with quote

Hello,

Quote:
So is there any statement through which we can set AutoCommit option to false explicitly.
I believe that is what the link describes. Did you read the part about "commit on return"? Did you try setting "commit on return" in your "create procedure"? If not, why not? It this was tried, what happens?
Back to top
View user's profile Send private message
Suresh Ponnusamy

Active User


Joined: 22 Feb 2008
Posts: 107
Location: New York

PostPosted: Fri Jan 16, 2009 2:06 am    Post subject:
Reply with quote

Hi Munish

COMMIT ON RETURN - YES/NO - In either case AUTO COMMIT will not be performed on succesful execution of each SQL statement inside the SP.

COMMIT ON RETURN - YES - On successful execution of the SP, all changes made to the tables would be committed.

COMMIT ON RETURN - No - Changes would not be committed until explicitly COMMIT is used. Generally when SP is called from JAVA, the commit operation will be performed at the front end.

Hope this helps,
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Jan 16, 2009 2:16 am    Post subject: Reply to: How to set Auto Commit turned off in DB2 stored pr
Reply with quote

Hi Suresh,

I couldn't find "auto commit" in the manual and thought "commit on return" might apply. . . .

Where is "auto commit" described?

Thanks,

d
Back to top
View user's profile Send private message
Munish Singla

New User


Joined: 18 Jul 2007
Posts: 21
Location: kolkata

PostPosted: Fri Jan 16, 2009 4:19 am    Post subject:
Reply with quote

Thanks.

Yes I tried "Commit on Return" statement.
When I specify "Commit on Retutn No" , it is getting compiled successfully.

But when I specify "Commit on Return Yes" it is not getting build.

I have specified the statement at the end of Create Procedure statement.

It is giving the following error
DB21034E The command was processed as an SQL statement because it was not a
valid Command Line Processor command. During SQL processing it returned:
SQL0104N An unexpected token "BEGIN" was found following " COMMIT ON RETURN
". Expected tokens may include: "NO". LINE NUMBER=18. SQLSTATE=42601

SQL0104N An unexpected token "BEGIN" was found following "
COMMIT ON RETURN


". Expected tokens may include: "NO



Please suggest.
Thanks
Munish
Back to top
View user's profile Send private message
Suresh Ponnusamy

Active User


Joined: 22 Feb 2008
Posts: 107
Location: New York

PostPosted: Fri Jan 16, 2009 9:45 pm    Post subject:
Reply with quote

Hi Dick,

AUTO COMMIT - I mean the Unit of Work is automatically getting Committed after successful completion of the program. Please note it is not a key word. Sorry, i should not have given this in Caps letter

Please refer the below link.

http://publib.boulder.ibm.com/infocenter/db2luw/v8/index.jsp?topic=/com.ibm.db2.udb.doc/ad/r0010308.htm
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sat Jan 17, 2009 4:19 am    Post subject: Reply to: How to set Auto Commit turned off in DB2 stored pr
Reply with quote

Hi Suresh,

Quote:
Sorry, i should not have given this in Caps letter
Not a problem icon_smile.gif

Thanks for the link.


Hi Munish,

If this is not yet working, it may help us help you if you post the code. . .

If it is working, please advise - your solution could help someone else later icon_smile.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Query on DB2 WLM stored procedures ashek15 DB2 8 Sun Feb 12, 2017 11:13 pm
No new posts Is the 'prompt' data for the DSLIST p... Willy Jensen TSO/ISPF 2 Tue Dec 06, 2016 4:38 am
No new posts Regarding COBOL Stored Procedure opti... selvamsrinivasan85 DB2 4 Fri Nov 04, 2016 8:57 pm
No new posts Access SQLCA fields inside a stored p... gangapd DB2 6 Thu Oct 27, 2016 10:20 am
No new posts Is possible to call subprogram from c... cmsmoon COBOL Programming 3 Fri Aug 05, 2016 6:46 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us