Preparing a statement
- Last UpdatedJun 17, 2024
- 1 minute read
Using the following functions, you can create any parameterized statement you want, and then dynamically fill in the parameters one by one. For example, you could save a generic statement in a file, load it using the SQLLoadStatement() function, prepare it using the SQLPrepareStatement() funtion to get a statement ID, and then fill in the statement parameters using the following functions:
-
SQLPrepareStatement()
-
SQLSetParamChar()
-
SQLSetParamDate()
-
SQLSetParamDateTime()
-
SQLSetParamDecimal()
-
SQLSetParamFloat()
-
SQLSetParamInt()
-
SQLSetParamLong()
-
SQLSetParamNull()
-
SQLSetParamTime()
-
SQLClearParam()
-
SQLClearStatement()
To perform parameter substitution on a SQL statement, place a "?" in the SQL statement where you want to specify a subsequent parameter. The statement is prepared, parameters are set into the statement, and then the statement is run.