SQLBindParameter binds a data buffer to a parameter marker in a SQL statement. Parameter markers are denoted by “?” in the SQL statement.
Syntax :
RETCODE SQLBindParameter (hStmt, paramNo, paramType, cType, sqlType, colDef, scale, value, valueMaxSize, valueSize )
Arguments :
The arguments for SQLBindParameter are listed in below table.
| Type | Name | Description |
| SQLHSTMT | hStmt | Statement handle |
| SQLUSMALLINT | ParamNo | The number of the parameter marker to bind to. Starts from 1, counted from left to right |
| SQLSMALLINT | paramType | Parameter type |
| SQLSMALLINT | cType | The C data type of the parameter |
| SQLSMALLINT | sqlType | The SQL data type of the parameter |
| SQLUINTEGER | colDef | The precision of the parameter |
| SQLSMALLINT | Scale | The scale of the parameter |
| SQLPOINTER | Value | Pointer to the buffer where the parameter value is stored |
| SQLINTEGER | valueMaxSize | The size of the parameter marker |
| SQLINTEGER * | valueSize | Actual size of the parameter value |
Returns :
This function returns SQL-SUCCESS if it is successful else SQL-ERROR.