Question & Answer
Question
How can I execute a stored procedure on the SQL server from a GUI script in IBM® Rational® Robot?
Answer
This assumes the stored procedure is already defined on the SQL server. For an example we will use a built-in stored procedure sp_help and the default sql sample database PUBS. The SQL syntax to execute the stored procedure should contain the "Exec" statement plus the procedure name.
Before calling a SQLEXEC query, a connection must be established with a data source using SQLOPEN. A successful call to SQLOPEN returns a unique connection ID number. SQLEXEC query uses that connection ID number to send SQL queries to the data source.
Any results generated from the query will not be returned immediately - SQLEXEC only executes the query. Retrieving results is handled by the functions SQLRETRIEVE and SQLRETRIEVETOFILE or Recordset objects to manipulate data in a database at the record level (see sample below).
Sample script:
|
All source code and/or binaries attached to this document are referred to here as "the Program". IBM is not providing program services of any kind for the Program. IBM is providing the Program on an "AS IS" basis without warranty of any kind. IBM WILL NOT BE LIABLE FOR ANY ACTUAL, DIRECT, SPECIAL, INCIDENTAL, OR INDIRECT DAMAGES OR FOR ANY ECONOMIC CONSEQUENTIAL DAMAGES (INCLUDING LOST PROFITS OR SAVINGS), EVEN IF IBM, OR ITS RESELLER, HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. |
---|
Historical Number
110814655
Was this topic helpful?
Document Information
More support for:
Rational Robot
Software version:
2003.06.00, 2003.06.10, 2003.06.12, 2003.06.13, 2003.06.14, 2003.06.15, 2003.06.16, 7.0, 7.0.0.1, 7.0.0.2, 7.0.0.3, 7.0.1, 7.0.1.1, 7.0.1.2, 7.0.0.4, 7.0.1.3, 7.0.2
Operating system(s):
Windows
Document number:
74575
Modified date:
16 June 2018
UID
swg21122038