vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi all, I'm trying to work out how I am going to develope some procs and functions within DB2. Usually what I do when playing with code and testing things is to write up an sql file containing the commands I want to run and then get the database to run it. Currently I am looking at writing scripts to load some initial data. As part of this I need to get the value from an identity field and pass it to several other procs and functions. It appears that DB2 only allows me to declare variables within a proc or function. However what I would like to do is to declare a variable, then call a function to populate it with a value, then pass the field to serveral following procs. Like this: declare var int; var = somefunction(); call someproca(var); call someprocb(var); call someprocc(var); ..... Is there any way to do something like this in DB2 without having to declare a proc containing this code ? I would like to be able to declare variables at the CLP level and used then whilst testing and playing with various procs. I would also like to be able to call a function from the command propt and display the returned result. Apart from embedding it in a select statement (which means it gets call for each record found) I can't figure out how to call it. Does anyone know how ? cio Derek. |