|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
DB2 UDB procedural SQL stored procedure
Late this afternoon I found out about the need to take a 3,200 line mainframe cobol DB2 stored procedure and duplicate the functionality with a UDB Procedural SQL stored procedure. Any thoughts/advice on the best approach to this? After pondering a bit I am thinking one main SP that calls a number of smaller SPs and passes back info to the main SP.
I have never done anything other than rather trivial stuff with these kind of SPs. Any thoughts appreciated, fv
__________________
...because that is the way we have always done it. We've been doing it like that for 80 Years! (How do we change that mindset?) |
|
#2
|
|||
|
|||
|
Well, I have one main stored procedure that will be called from the client with a few parameters. There is another SP that is called repeatedly to handle updates to a transaction table, and about 10 other SPs called that return result sets or a few parameters. So far so good. The main SP is up to about 800 lines I'd guess and a bit more to go.
Next I have to figure out the error-handling and cascading errors from the called SPs to the main SP and back to the client. Also how to roll back the whole thing should any part fail.... Ideas most welcome, FV |
|
#3
|
|||
|
|||
|
Well, all these stored procedures run fine from within the DB2 Develoment Center. All that I tried get an SQL0444N from the lightweigt query tool I like to use, WinSQL (the free version). Someone suggest using parameter markers for the OUT parameters as in
CALL mysp('123456',?,?); I tried this from the script runner tool in Quest (very nice software) and it ran nicely and very quick. Tried the same in WinSQL - it doesn't like it at all! So my initial panic at the SQL0444N was based on bogus criteria. The Db2 Development Center is a really nice tool with good features, but if you lock your screen to leave your desk it goes into limbo and you have to ctrl + alt + delete and kill it when you return and unlock the screen.... SQL PL is really interesting. Much more to learn. I found myself wanting to put semi-colons after statements while working on a VB app this afternoon ;-) fv |
![]() |
| Viewing: Dev Shed Forums > Databases > DB2 Development > DB2 UDB procedural SQL stored procedure |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|