Re: when to return SQL_NO_DATA from SQLExecute/SQLExecDirect

jon pounder <[email protected]>
Newsgroups gmane.comp.db.unixodbc.devel
Message-ID <[email protected]>
On 10/30/2012 06:07 PM, Nick Gorham wrote:
> On 30/10/12 22:01, jon pounder wrote:
>> On 10/30/2012 05:48 AM, Peter Harvey wrote:
>>
>> I have run into that before and I think its pretty common actually.
>> No data does not necessarily mean error at all.
>
> Hi Jon, long time no email.
yes its been a while.
>
> SQL_NO_DATA should be only returned when a update or delete query uses 
> a search that returns no rows.
>
> ie
>
> delete from table where col = 10
>
> if there are no rows in table that have a col value 10.

That stuff kind of goes by the wayside in cases where there are say 
functions in postgres, and they may be volatile (contain 
update/insert/delete or immutable (select only)  the function is 
technically always executed as a select.

That gets further blurred where an immutable function may use a dblink 
to do an update to another database.

I know I usually just rely on <> SQL_ERROR where I care if it failed or 
not and get the actual rows affected or result rows where that matters.







_______________________________________________
unixODBC-dev mailing list
[email protected]
http://mailman.unixodbc.org/mailman/listinfo/unixodbc-dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.