Skip to Content.
Sympa Menu

freetds - Re: [freetds] SQLExecDirect() + SQLDataParam() + SQLPutData() fails

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Frediano Ziglio <freddy77 AT gmail.com>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] SQLExecDirect() + SQLDataParam() + SQLPutData() fails
  • Date: Tue, 3 Jul 2018 05:54:45 +0100

2018-06-29 14:50 GMT+01:00 Sebastien FLAESCH <sf AT 4js.com>:
> Attached, the code example to reproduce:
>
> When using SQLPrepare() + SQLExecute():
>
> $ gcc -D USE_PREP_EXEC -o odbctest3.bin odbctest3.c ...
>
> $ ./odbctest3.bin
>>> prepare insert...
>>> bind ...
>>> execute...
>>> param data...
>>>>>> put varchar(max)
>>> param data...
>
>
> When using SQLExecDirect():
>
> $ gcc -o odbctest3.bin odbctest3.c ...
>
> $ ./odbctest3.bin
>>> bind ...
>>> exec direct...
>>> param data...
>>>>>> put varchar(max)
> Error -1 at: SQLPutData 1
> Diagnostic info:
> SQL State: HY010
> SQL code : 0
> Message : [FreeTDS][SQL Server]Function sequence error
>
>
> What is wrong in my ODBC function sequence?
>
> Cheers,
> Seb
>
>

I'll have to dig, no idea, the initial SQL_NEED_DATA is detected.

Frediano

>
> On 06/29/2018 03:09 PM, Sebastien FLAESCH wrote:
>>
>> Hi all,
>>
>> Just asking before sending a little code sample to reproduce:
>>
>> Is there a know limitation regarding VARCHAR(MAX)/VARBINARY(MAX)
>> parameters
>> and SQLExecDirect() + SQLParamData() + SQLPutData() ?
>>
>> When using SQLPrepare() + SQLExecute() + SQLParamData() + SQLPutData(), I
>> can
>> send Large Objects, but with SQLExecDirect(), I get the error:
>>
>> [FreeTDS][SQL Server]Function sequence error
>>
>> When doing the first SQLPutData() ...
>>
>> Seb
>> _______________________________________________
>> FreeTDS mailing list
>> FreeTDS AT lists.ibiblio.org
>> https://lists.ibiblio.org/mailman/listinfo/freetds
>>
>
>
> _______________________________________________
> FreeTDS mailing list
> FreeTDS AT lists.ibiblio.org
> https://lists.ibiblio.org/mailman/listinfo/freetds
>



  • Re: [freetds] SQLExecDirect() + SQLDataParam() + SQLPutData() fails, Frediano Ziglio, 07/03/2018

Archive powered by MHonArc 2.6.24.

Top of Page