Thanks for a detailed response, Dennis. 

Under some time constraints, I just finished an important implementation
and used the callback function as the means of acquiring returned data. 

I don't want that interface to become obsolete any time soon. Maybe I need
to consider migrating to the newer, preferred interface.

Lee

________________________________


-----Original Message-----
From: Dennis Cote [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 07, 2007 5:08 PM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] Extremely new to SQLite

Lee Crain wrote:
> Dennis,
>
> Are you certain that the callback function interface has been
deprecated? 
>
> >From the link you posted:
>
> ---------------
>
> "2.2 Executing SQL statements
>    typedef int (*sqlite_callback)(void*,int,char**, char**);
>    int sqlite3_exec(sqlite3*, const char *sql, sqlite_callback, void*,
> char**);
> The sqlite3_exec function works much as it did in SQLite version 2. Zero
> or more SQL statements specified in the second parameter are compiled
and
> executed. Query results are returned to a callback routine."
>
> ---------------
>
> I couldn't find a reference to its deprecation.
>
>   
Lee,

Perhaps depreciated may be too strong, but it is no longer recommended. 
If you continue reading in the section you quoted you will find the 
following:

> In SQLite version 3, the sqlite3_exec routine is just a wrapper around 
> calls to the prepared statement interface.
>
>        typedef struct sqlite3_stmt sqlite3_stmt;
>        int sqlite3_prepare
<http://www.sqlite.org/capi3ref.html#sqlite3_prepare>(sqlite3*, const
char*, int, sqlite3_stmt**, const char**);
>        int sqlite3_prepare16
<http://www.sqlite.org/capi3ref.html#sqlite3_prepare16>(sqlite3*, const
void*, int, sqlite3_stmt**, const void**);
>        int sqlite3_finalize
<http://www.sqlite.org/capi3ref.html#sqlite3_finalize>(sqlite3_stmt*);
>        int sqlite3_reset
<http://www.sqlite.org/capi3ref.html#sqlite3_reset>(sqlite3_stmt*);
>         
>
> The sqlite3_prepare interface compiles a single SQL statement into 
> byte code for later execution. This interface is now the preferred way 
> of accessing the database.
>
The last sentence is the basis for my claim.

I still use sqlite3_exec all the time, but only to execute statements 
that don't return a result set. Hence, I think it is really the callback 
mechanism that has been depreciated, not sqlite3_exec itself.

The callback mechanism is still supported for backwards compatibility, 
which is why the quickstart code (along with lots of other existing 
sqlite client code) still works, but it should not be used for new code.

HTH
Dennis Cote

--------------------------------------------------------------------------
---
To unsubscribe, send email to [EMAIL PROTECTED]
--------------------------------------------------------------------------
---



-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to