View previous topic :: View next topic
|
Author |
Message |
gbtech
New User
Joined: 22 Aug 2007 Posts: 3 Location: new york
|
|
|
|
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 |
|
|
ashwinreddy
Active User
Joined: 16 Sep 2004 Posts: 106 Location: Hyderabad
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
ashwinreddy
Active User
Joined: 16 Sep 2004 Posts: 106 Location: Hyderabad
|
|
|
|
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 |
|
|
socker_dad
Active User
Joined: 05 Dec 2006 Posts: 177 Location: Seattle, WA
|
|
|
|
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 |
|
|
gbtech
New User
Joined: 22 Aug 2007 Posts: 3 Location: new york
|
|
|
|
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 |
|
|
stodolas
Active Member
Joined: 13 Jun 2007 Posts: 632 Location: Wisconsin
|
|
|
|
Doesn't the commit happen implicitly on the completion of the stored procedure? |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Finally, thank you Steve............ |
|
Back to top |
|
|
|