Thank you for the link.
Then I started solving the callback problem. After a bit research, I found
out that I could end up with a new exec() function. So I took the original
exec() and modified it. It's working, no guaratee :-D
int sqlite3_exec16(
sqlite3 *db,/* The database on which the SQL executes */
const short *zSql, /* The SQL(16) to be executed */
sqlite3_callback16 xCallback, /* Invoke this callback routine */
void *pArg, /* First argument to xCallback() */
short **pzErrMsg /* Write error messages here */
){
int rc = SQLITE_OK;
const short *zLeftover;
sqlite3_stmt *pStmt = 0;
short **azCols = 0;
int nRetry = 0;
int nCallback;
if( zSql==0 ) return SQLITE_OK;
while( (rc==SQLITE_OK || (rc==SQLITE_SCHEMA && (++nRetry)<2)) && zSql[0]
){
int nCol;
short **azVals = 0;
pStmt = 0;
rc = sqlite3_prepare16_v2(db, zSql, -1, , );
assert( rc==SQLITE_OK || pStmt==0 );
if( rc!=SQLITE_OK ){
continue;
}
if( !pStmt ){
/* this happens for a comment or white-space */
zSql = zLeftover;
continue;
}
nCallback = 0;
nCol = sqlite3_column_count(pStmt);
azCols = sqliteMalloc(2*nCol*sizeof(const short *) + 1);
if( azCols==0 ){
goto exec_out;
}
while( 1 ){
int i;
rc = sqlite3_step(pStmt);
/* Invoke the callback function if required */
if( xCallback && (SQLITE_ROW==rc ||
(SQLITE_DONE==rc && !nCallback && db->flags_NullCallback))
){
if( 0==nCallback ){
for(i=0; ierrMask)==rc );
return rc;
}
Kees Nuyt wrote:
>
>
> This page tells it all in a nutshell:
> http://www.sqlite.org/c3ref/stmt.html
> --
> ( Kees Nuyt
>
-
www.folksfun.com
--
View this message in context:
http://www.nabble.com/How-to-use-sqlite3_exec%28%29-to-execute-SQL-command-with-Unicode-text--tp25663732p25728190.html
Sent from the SQLite mailing list archive at Nabble.com.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users