Home How To Online Documentation Support Download Order



Connecting to databases
Executing an SQL command
Executing stored procedures
Binding input parameters
Fetching result set
Fetching multiple result sets
Optimizing Database Performance
Returning output parameters
Working with Long or Lob(CLob, BLob) Data
Working with date/time values
Error handling
Using native API
Query examples

Returning Output Parameters

If stored procedure does not generate result set(s) you can reach output parameters immediately after calling SACommand::Execute:

printf("%d\n", cmd.Param("nOutput").asLong());

You can use SAParam operators for quick accessing values. In this case you can process the result as shown below:

long out_param = cmd.Param("nOutput");
printf("%d\n", out_param);

After the statement has been executed, SQLAPI++ stores the returned values of output parameters in the SAParam objects bound to those parameters. On some servers these returned values are not guaranteed to be set until all results returned by the procedure have been fetched (using SACommand::FetchNext method). See Server specific information on output parameters availability on different DBMSs.

For processing result set(s) (if any) see Fetching result set and Fetching multiple result sets.

If you call a function SQLAPI++ Library automatically creates SAParam object to represent the function return value. You can refer to this SAParam object using SQLAPI++ predefined name "RETURN_VALUE".

Returning Long, BLob and CLob data can have some differences (if you need piecewise operations) from other data types. See Working with Long or Lob(CLob, BLob) Data to get more information.

Problems and Questions

If you haven't found the answer to your questions or have some problems on using the Library, please, send e-mail to howto@sqlapi.com.