[freetds] SQLExecDirect() of transaction statement returnsSQL_NO_DATA
Sebastien FLAESCH
sf at 4js.com
Tue Jan 8 08:15:25 EST 2008
Ok that makes total sense.
Thanks!
Seb
ZIGLIO, Frediano, VF-IT wrote:
>> Is it expected that an SQLExecDirect("BEGIN TRANSACTION")
>> returns SQL_NO_DATA (100) ?
>>
>> I would maybe expect SQL_SUCCESS_WITH_INFO, but not SQL_NO_DATA ...
>>
>> Attached, a sample to reproduce, give me this output:
>>
>> >> SQLExecDirect return code = 100 for [BEGIN TRANSACTION]
>> >> SQLExecDirect return code = 100 for [COMMIT TRANSACTION]
>> >> SQLExecDirect return code = 100 for [BEGIN TRANSACTION]
>> >> SQLExecDirect return code = 100 for [ROLLBACK TRANSACTION]
>> >> SQLExecDirect return code = 100 for [SET TRANSACTION
>> ISOLATION LEVEL READ UNCOMMITTED]
>> >> SQLExecDirect return code = 100 for [SET TRANSACTION
>> ISOLATION LEVEL READ COMMITTED]
>> >> SQLExecDirect return code = 100 for [SET TRANSACTION
>> ISOLATION LEVEL REPEATABLE READ]
>> >> SQLExecDirect return code = 100 for [SET TRANSACTION
>> ISOLATION LEVEL SERIALIZABLE]
>>
>> Seb
>>
>
> Using ODBC 3 SQLExecDirect/SQLExecute can return SQL_NO_DATA with means
> SQL_SUCCESS with no rows, from manual
>
> "If SQLExecDirect executes a searched update or delete statement that
> does not affect any rows at the data source, the call to SQLExecDirect
> returns SQL_NO_DATA.
> "
>
> there are more sligthly difference between MS ODBC and our driver but
> any ODBC compliant applications should support both results (in this
> case is complitely correct). Personally sometimes I use a macro defined
> as
>
> #define SQL_SUCCEEDED_EX(rc) (((rc) & 2) == 0)
>
> which catches SQL_SUCCESS, SQL_SUCCESS_WITH_INFO and SQL_NO_DATA.
>
> freddy77
> _______________________________________________
> FreeTDS mailing list
> FreeTDS at lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/freetds
>
More information about the FreeTDS
mailing list