Download Database - National Instruments

Transcript
Chapter 5
SQL Toolkit Library Reference — DBSetParamAttribute
/* Prepare a statement that calls the stored procedure. */
resCode = DBSetAttributeDefault(hdbc, ATTR_DB_COMMAND_TYPE,
DB_COMMAND_STORED_PROC);
hstmt = DBPrepareSQL (hdbc, "sp_Adotest");
/* Create
resCode =
resCode =
resCode =
the parameters. */
DBCreateParamDouble(hstmt, "", DB_PARAM_RETURN_VALUE, -1);
DBCreateParamDouble(hstmt, "", DB_PARAM_INPUT_OUTPUT, 10);
DBCreateParamDouble(hstmt, "OutParam", DB_PARAM_OUTPUT,
-1);
/* Modify the second parameter. */
resCode = DBSetParamAttribute (hstmt, 2, ATTR_DB_PARAM_DIRECTION,
DB_PARAM_INPUT);
resCode = DBSetParamAttribute (hstmt, 2, ATTR_DB_PARAM_VALUE,
CA_VariantDouble (42.42));
/* Execute the prepared statement. */
resCode = DBExecutePreparedSQL(hstmt);
/* Close the statement. The statement must be closed
/* before you can examine the output parameters.
resCode = DBClosePreparedSQL(hstmt);
LabWindows/CVI SQL Toolkit Reference Manual
5-240
*/
*/
© National Instruments Corporation