[freetds] SQL_NO_DATA or SQL_SUCCESS
peterd at iea-software.com
Wed Feb 27 12:11:42 EST 2008
On Wed, 27 Feb 2008, James K. Lowden wrote:
>> Mmmm... as said if nobody complains I would commit... so I complain :)
>> Yes, it seems that DELETE/UPDATE with no rows produce SQL_NO_DATA!!
>> However I must say that as documented only DELETE/UPDATE with no rows
>> should return SQL_NO_DATA. The situaction is complicated by the fact
>> that only mssql (no Sybase) return proper informations to detect
>> UPDATE/DELETE execution!
> I'm sure you've read the above confusing page more than once. It says
> that whether SQLExecute returns SQL_NO_DATA or SQL_SUCCESS depends on:
> 1. Whether the *application* is 2.x or 3.x.
> 2. Whether the "searched update or delete" was part of a batch.
> 3. Whether any rows were affected.
> According to the documentation, then, SQLExecute returns SQL_NO_DATA only
> 1. a "searched update or delete" is not part of a batch -- or, I presume,
> a stored procedure -- and
> 2. is issued by a 3.x application, and
> 3. affected zero rows.
FWIW I didn't realize version mattered. I was able to reproduce the
SQL_NO_DATA by capturing a trace from isqlw/sql2000.
isqlw 1298-674 EXIT SQLExecDirectW with return code 100
WCHAR * 0x0016C0B8 [ -3] "UPDATE Configs
SET ConfigID = 4343 WHERE ConfigID = 43240324\ d\ a\ 0"
> (I do not know what a "searched update" is. I guess it means one with a
> WHERE clause. If I issue "UPDATE tablename SET columname = 0" on a table
> with zero rows, it affects zero rows. What should the driver return
Yea, searched updates are exactly that.
More information about the FreeTDS