简体   繁体   中英

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??

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM