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

Stored procedures commits


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

New User


Joined: 22 Aug 2007
Posts: 3
Location: new york

PostPosted: Fri Aug 24, 2007 11:53 pm
Reply with quote

Hi All,

I was asked the following on an interview:

If a client application calls a stored procedure that does an update who does a commit providing that stored procedure is not the one doing it?

Any thoughts on this are appreciated.
Back to top
View user's profile Send private message
ashwinreddy

Active User


Joined: 16 Sep 2004
Posts: 106
Location: Hyderabad

PostPosted: Fri Aug 24, 2007 11:56 pm
Reply with quote

Hi,

am totally confused on your question, do you intend that the store procedure is not updating the records or something else.

could you provide us more information or expand your sentence.

Cheers
Ashwin
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Sat Aug 25, 2007 12:13 am
Reply with quote

If a client application calls a stored procedure that does an update,
who does a commit providing that stored procedure is not the one doing it? (the commit)
Back to top
View user's profile Send private message
ashwinreddy

Active User


Joined: 16 Sep 2004
Posts: 106
Location: Hyderabad

PostPosted: Sat Aug 25, 2007 12:13 am
Reply with quote

Hi,


I assuming your question as your Store procedure is not updating as expected.

First Check whether the DDL declarations for the store procedure are as per your requiremnt.

And if you are testing your SP (stored Procedure) using batch then check the calling program passing values (Inputs you pass) and declarations.

If everything is ok, so you have to place the display statments before execution of that SQL and after that. check the SQL code.

And remember SP can't be debugged using a Debugging tools. Only option is placing displays.

Hope this Helps

Cheers
Ashwin
Back to top
View user's profile Send private message
socker_dad

Active User


Joined: 05 Dec 2006
Posts: 177
Location: Seattle, WA

PostPosted: Sat Aug 25, 2007 3:41 am
Reply with quote

To get back on track of your original question, I would have answered, "When the stored procedure returns control to the calling module." and prayed that I was right!
Back to top
View user's profile Send private message
gbtech

New User


Joined: 22 Aug 2007
Posts: 3
Location: new york

PostPosted: Sat Aug 25, 2007 3:44 am
Reply with quote

I have assumed from the interview question that the stored proc was called from a non-mainframe application (i.e. not from CICS where one could do a syncpoint or a batch program where one could do an exec sql commit). Then if the stored proc does an update who issues a commit?
Back to top
View user's profile Send private message
stodolas

Active Member


Joined: 13 Jun 2007
Posts: 632
Location: Wisconsin

PostPosted: Sat Aug 25, 2007 4:13 am
Reply with quote

Doesn't the commit happen implicitly on the completion of the stored procedure?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Sat Aug 25, 2007 4:38 am
Reply with quote

Finally, thank you Steve............
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 Invoke stored procedure via batch JCL. DB2 2
No new posts Infosphere Optim - unable to save Col... IBM Tools 0
No new posts Calling COBOL DB2 program from a COBO... COBOL Programming 2
No new posts user exits in Column Map procedures IBM Tools 0
This topic is locked: you cannot edit posts or make replies. Internal Autonomous Stored Procedure ... DB2 6
Search our Forums:

Back to Top