On 18 Jan 2011, at 11:02am, Sachin Gupta 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 @.

Use the SQLite command-line tool instead.

<http://www.sqlite.org/sqlite.html>

> I was wondering whether the same could be achieved with SQLite (in Memory). I 
> know can be done via code pretty easily, but still if we have the schema and 
> data in a text file, it would help a lot.

Well they are just SQL commands.  Just read them in and execute them line by 
line.

Or you can invoke the command-line tool and send the contents of your text file 
to it, something like

sqlite3 filename.sql3 < textfile.txt

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

Reply via email to