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

Michel Chamberland mercjr at gmail.com
Thu Aug 18 16:42:17 BST 2011


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))



On Thu, Aug 18, 2011 at 11:22 AM, Nick Gorham <nick at lurcher.org> wrote:

> On 18/08/11 16:17, Michel Chamberland wrote:
>
>> Thanks for the response!
>> I am zooming in on the Value = 0x2 seen in the SQLParamData trace output.
>> Looks like an invalid pointer, I may not be binding the parameter correctly?
>> If that is the case, i'm wondering how it worked with datadirect drivers
>> though...
>>
>
> The value you bind when using data at execution is just a reference to
> allow the code to decide what column data is being requested for, so 2 is
> entirly possible. Can't say more for certain without knowing of the code in
> question.
>
>
> --
> 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/6105f2ef/attachment.html>


More information about the unixODBC-support mailing list