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

Michel Chamberland mercjr at gmail.com
Thu Aug 18 20:06:12 BST 2011


had a breakthru, im now using named parameters (ie: @imgBlob = ?) and that
is working, i can insert a blob in the database. However, i'm not sure what
the syntax for a return value should be

{ ? = call myproc ( @imgBlob = ? ) }

is that valid? doesnt seem to work...

thanks much for all the input today!

On Thu, Aug 18, 2011 at 12:13 PM, Nick Gorham <nick at lurcher.org> wrote:

> 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
> ______________________________**_________________
> unixODBC-support mailing list
> unixODBC-support at mailman.**unixodbc.org<unixODBC-support at mailman.unixodbc.org>
> http://mailman.unixodbc.org/**mailman/listinfo/unixodbc-**support<http://mailman.unixodbc.org/mailman/listinfo/unixodbc-support>
>



-- 
mercjr at gmail.com
CEH, CCNA, CCNA Security, Security+, Network+, A+, Project+, MCP, CIW
Professional/JavaScript Specialist/Database Design Specialist
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.unixodbc.org/pipermail/unixodbc-support/attachments/20110818/c25a20fc/attachment-0001.html>


More information about the unixODBC-support mailing list