Hi all,

DROP TABLE IF EXISTS foo;

does not seem to work via the C-API. If I type it in sqlite3 it works fine.

When I tried via the C-API, I got the following:

SQL: drop table if exists addr;

SQL error: near "exists": syntax error


My code is:

         strcpy(sql, "drop table if exists ");
         strcat(sql, tablename);
         strcat(sql, ";\n");

         rc = sqlite3_exec(db, sql, NULL, NULL, &zErrMsg);
         if( rc!=SQLITE_OK ){
             fprintf(stderr, "SQL: %s\n", sql);
             fprintf(stderr, "SQL error: %s\n", zErrMsg);
             sqlite3_free(zErrMsg);
         }

Can anyone reproduce this?
Did I do something wrong? (likely :)

Thanks,
   -Steve
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to