Joanne Pham <[EMAIL PROTECTED]> wrote:
> I have the following codes to execute the sql file but the error
> message return back that dot(.).
> It seems like sqlite3_exec didn't like ".output wanPerfTableTest".
> So how go to get arround with this command ".output wanPerfTableTest"
>
> strcpy(&stmt[0],".read /tmp/dump_WAN.sql");
> if (bIsConnected) {
>  sqlSt= sqlite3_exec(pDb,stmt , NULL, 0, &errMsg);
>      if (sqlSt != SQLITE_OK ) {
>           ...................
>      }
> }

Dot commands (.output and, for that matter, .read) are interpreted by 
sqlite3 command line utility - not by SQLite engine. They are not valid 
SQL statements. sqlite3_exec complains about .read already, it never 
actually reads the file (so the presence of .output in the file is 
irrelevant).

SQLite won't read the file for you, you will have to do it yourself (and 
probably strip all dot commands from it before passign the contents to 
sqlite3_exec).

Alternatively, just shell out to sqlite3 utility with an appropriate 
command line.

Igor Tandetnik



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

Reply via email to