On Feb 7, 2008 9:32 AM, Jeff Rogers <[EMAIL PROTECTED]> wrote:>
>
> The problem is straightforward - the driver checks how many rows are
> returned after executing a statement; 0 returns NS_DML and >0 returns
> NS_ROWS.  'ns_db select' and '0or1row' expect NS_ROWS results, even if
> there are no rows to be read (which is a perfectly valid result).
>
> So how to fix it?  There's no direct way to tell what kind of statement
> was parsed in the sqlite api (unlike say, OCI) and checking how many
> rows were changed will give bad results for an update affecting no rows.


    sqlite3_stmt *st;

    sqlite3_prepare_v2(handle, sql, length, &st, &tail)

    if (sqlite3_column_count(st) == 0) {
        /* DML */
    }


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]> 
with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: 
field of your email blank.

Reply via email to