[unixODBC-support] Fwd: Issue with SQLParamData and SQLPutData and image column

Nick Gorham nick at lurcher.org
Thu Aug 18 17:13:29 BST 2011


On 18/08/11 16:42, Michel Chamberland wrote:
> I see, it now make sense, i wrote this code 10 years ago and not so 
> fresh in my mind anymore :)
> Here is the code, SQLParamData does put a 0x2 value in the seccond 
> parameter i pass to it to tell me thats the parameter we are talking 
> about so I was probably down the wrong path here..
> SQLINTEGER filedata;
> SQLPOINTER pToken;
> SQLBindParameter(hstmt, 2, SQL_PARAM_INPUT,
>                                     SQL_C_BINARY, SQL_LONGVARBINARY,
>                                     0, 0, (SQLPOINTER) 2, 0, &filedata 
> ); <-- success
> (omitted, there is also a parameter 1 and 3 involved)
> filedata = SQL_LEN_DATA_AT_EXEC(blobsize);
> SQLExecute(hstmt); <-- success
> SQLParamData(hstmt, &pToken); <-- success (pToken is set to 0x2)
> SQLPutData(hstmt, Data, cbData); <-- success
> SQLParamData(hstmt, &pToken); <-- fail (pToken is set to 0x2 and 
> SQLGetDiagRec cant find anything(looking at stmt, env and dbc))

Makes sense and looks correct then. I would check if blobsize == cbData

-- 
Nick


More information about the unixODBC-support mailing list