Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to call a stored procedure in IBM System i Access for Windows GUI Tool

I would like to test a DB2 stored procedure running on an AS400 system.

I have the IBM System i Access for Windows installed and can run SQL commands against the DB2 database.

My question is: What is the syntax to execute a stored procedure that takes in a parameter and returns a result as an output parameter and print the value to the screen?

Just to clarify: I am not asking how to call the proc in code. I want to execute the proc and see the results in the gui tool (which is similar to SQL Enterprise Manager).

like image 456
Ken Burkhardt Avatar asked Jan 22 '10 17:01

Ken Burkhardt


People also ask

How do you call a stored procedure in DB2?

db2 file catalogs the stored procedures. To call this stored procedure, you need to put in a CHAR value for the IN parameter, job , and a question mark, '?' , for each of the OUT parameters.

How do we call stored procedure?

You can call an SQL stored procedure with the execute, open, or get statement; in each case, you use the #sql directive. A stored procedure is a set of instructions for a database, like a function in EGL.


1 Answers

use the keyword call and pass in the parameters.

call myStoredProc(parm1, parm2, ?);

for more details see here http://www.ibm.com/developerworks/data/library/techarticle/dm-0503melnyk/. The interesting part is Figure 5. Using the Command Editor to call an SQL procedure

like image 167
Peter Schuetze Avatar answered Oct 12 '22 11:10

Peter Schuetze