You mean read it line by line and pass it as const char* to sqlite3_exec? 

Regards
Sachin


-----Original Message-----
From: [email protected] [mailto:[email protected]] 
On Behalf Of Igor Tandetnik
Sent: Tuesday, January 18, 2011 5:52 PM
To: [email protected]
Subject: Re: [sqlite] How to execute SQL Query via text/sql file

Sachin Gupta <[email protected]> wrote:
> We want that the SQLite schema and data be written in a text file. When the 
> application comes up, the SQL file can be executed to
> create the schema and import the data. The text file would have the Create 
> Table statements and also the insert into table
> statements. Similar thing was being done by our application previously. We 
> had a some SQL files and we used to execute these via
> code by creating a command invoking sqlplus and passing the file with a @.  
> 
> I was wondering whether the same could be achieved with SQLite (in Memory).

If the file is reasonably small, just load the whole thing in memory and pass 
it to sqlite3_execute in a single call.
-- 
Igor Tandetnik

_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to