Re: SQL_SUCCEEDED macro / SQL_NO_DATA for CREATE TABLE

Sebastien FLAESCH <[email protected]> Fri, 19 Oct 2018 16:35:17 +0200
Newsgroups gmane.comp.db.tds.freetds
Organization Four Js Development Tools
Message-ID <[email protected]>
Hi Frediano,

Good point, I saw now in the doc that there is a different expectation with ODBC 2.x and ODBC 3.x!

So that means that we should prepare the code to check for SQL_SUCCEEDED() or SQL_NO_DATA after SQLExec*()

I guess you mean this macro:

#define SQL_SUCCEEDED_EX(R) (((R) & 2) == 0)

ODBC standard headers should then provide such macro to cover all valid return values.

Seb

On 10/19/18 1:08 PM, Frediano Ziglio wrote:
> I think mostly historic reasons.
> I remember I wrote a macro that considered SQL_NO_DATA as success too
> to use in these cases.
> Is not clear the distinction between SQL_NO_DATA and SQL_SUCCESS in
> these cases, seems that for instance updates/inserts should return
> SQL_NO_DATA and not SQL_SUCCESS according to the documentation.
> Maybe would be good to check and change for version 1.1.
> 
> Frediano
> 
> Il giorno mer 10 ott 2018 alle ore 15:43 Sebastien FLAESCH
> <[email protected]> ha scritto:
>>
>> Hi all,
>>
>> Must have been discussed several times:
>>
>> Why does FreeTDS APIs return SQL_NO_DATA for an DDL SQL such as
>> CREATE TABLE, when other ODBC drivers just return 0/SQL_SUCCESS
>> (or 1/SQL_SUCCESS_WITH_INFO)?
>>
>> This prevents us to use the standard SQL_SUCCEEDED() macro.
>>
>> Seb
>> _______________________________________________
>> FreeTDS mailing list
>> [email protected]
>> https://lists.ibiblio.org/mailman/listinfo/freetds
> _______________________________________________
> FreeTDS mailing list
> [email protected]
> https://lists.ibiblio.org/mailman/listinfo/freetds
>