Using Static Statements
TO BE SUPPLIED
Using Prepared Statements
+ START OF MATERIAL FROM RELEASE NOTES
SQLPrepare()
with a string containing a SQL statement, the driver sends the string to the server and stores the statement identifier for later execution. The string is stored on the server and thus is not sent again when the prepared statement is executed more than once.SQLBindParameters(),t
he driver binds the statement parameters but does not communicate with the server.Question for reviewers: is SQLBindParameters singular or plural? The text does not agree with the example code. Has the example been tested?
SQLExecute
, the driver sends the statement identifier and parameter values to the server and returns the result set or an error. The driver also returns semantic and syntactic errors at this point.ODBC Example
SQLPrepare(hstmt,
"UPDATE Parts SET Price = ? WHERE PartID = ?", SQL_NTS);
SQLBindParameter(hstmt, 1, SQL_PARAM_INPUT,
SQL_C_FLOAT, SQL_REAL, 7, 0, &Price, 0, &PriceInd);
SQLBindParameter(hstmt, 2, SQL_PARAM_INPUT,
SQL_C_ULONG, SQL_INTEGER, 10, 0, &PartID, 0, &PartIDInd);
SQLExecute(hstmt);
- END OF MATERIAL FROM RELEASE NOTES