SQLRETURN SQLPutData(SQLHSTMT StatementHandle, SQLPOINTER DataPtr, SQLINTEGER StrLen_or_Ind);
SQLPutData peut être appelée plusieurs fois.
Le résultat est SQL_SUCCESS en cas de succès.
#include <sqlcli1.h>
static SQLHANDLE hOrdreSql;
static char *B;
static char *BBis;
...
if (SQLBindParameter(hOrdreSql, 1, SQL_PARAM_INPUT, SQL_C_BINARY, SQL_LONGVARBINARY, 0, 0, (SQLPOINTER)&B, sizeof(unsigned char *), SQL_DATA_AT_EXEC)!=SQL_SUCCESS)
{
...
}
...
if (SQLExecDirect(hOrdreSql, "insert into emp ('SCOTT', '10', '3264', ?);", SQL_NTS)!=SQL_NEED_DATA)
{
...
}
...
if (SQLParamData(hOrdreSql, (SQLPOINTER)&BBis)!=SQL_SUCCESS)
{
...
}
...
if (SQLPutData(hOrdreSql, (SQLPOINTER)"coucou", SQL_NTS)!=SQL_SUCCESS)
{
...
}
...
if (SQLParamData(hOrdreSql, NULL)!=SQL_SUCCESS)
{
...
}
...