On 21 May 2009, at 4:43am, Debjit Saha wrote:

> I have a SQL Dump created from a database in MySQL.

This is a text file that looks like a lot of SQL commands, right ?   
And I assume this is a one-off thing you need to do, not something  
you're going to need to do repeatedly.

> Now I want to import
> that dump into an SqLite database. Is thatpossible? If yes, please  
> tell me
> how.


Use the 'sqlite3' command.

Create the tables manually, because the syntax isn't quite the same  
and you're going to want to use slightly different column types.

Copy one INSERT command out of the dump and test it by pasting it into  
sqlite3 and checking to see that it works as intended.  You may need  
to make minor changes such as globally replacing one kind of quote  
character with another.

Once you have a format that works, put all the appropriate INSERT  
commands into a text file and use the '.read' command from 'sqlite3'  
to execute all the commands.

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

Reply via email to