DB2 stored procedure and number of affected rows retrieved

Source: Internet
Author: User

Test the creation of the DB2 stored procedure and use get diagnostics to return the affected rows:

Create a file in. IO in the current directory

 
--In. IoCreate ProcedureProc1 (Out rowsInteger) Language SQLBeginUpdateTb1SetName=Name; get diagnostics rows=Row_count;End@

Run:

--Create procedure where-TD is used to specify the terminator; and @-V is used to specify the file to be executed by the command-F in the output fileDB2-TD @-VFIn. Io--Execute procedure \ is an escape character. You can also use DB2 "Call proc1 (?) "? Number is the output parameterDB2 call proc1 \(? \)

 

Refer:

Get diagnostics use: http://publib.boulder.ibm.com/infocenter/db2luw/v8/index.jsp? Topic =/com.ibm.db2.udb.doc/admin/r0005647.htm

Create procedure Syntax: http://publib.boulder.ibm.com/infocenter/db2luw/v8/index.jsp? Topic =/com.ibm.db2.udb.doc/admin/r0005647.htm

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.