zod
zod

Reputation: 12417

shell command for executing stored procedure in DB2 OS400

what is the shell command for executing stored procedure in DB2 OS400.

CALLPRC PRC(SPNAME) PARM('','',5,'','') RTNVAL()

what is this one??

Upvotes: 0

Views: 1610

Answers (1)

dmc
dmc

Reputation: 2684

Assuming you've got a stored procedure called SPNAME, here's how you'd run it through SQL on DB2:

CALL SPNAME('', '', 5, '', '');

This of course assumes that you've already got a database connection through which you can execute SQL statements.

A couple of things you'll probably have to worry about:

  1. You will probably have to specify the program's library like this: CALL LIBNAME.SPNAME(...). Or you can use SET PATH=LIBNAME to provide a list of libraries to search.
  2. You will want to look into parameter binding. This will allow you to pass input values to the procedure and get back the output values.

This link explains how to execute a stored procedure in PHP using ODBC.

Upvotes: 1

Related Questions