Is it possible to import a sql file into sqlite?

General topics about the Android-Platform itself.
Coding issues please to the subforum right below.

Is it possible to import a sql file into sqlite?

Postby fwaokda » Tue Mar 23, 2010 5:23 pm

How would I go about importing a sql file into sqlite? I'm in the process of getting it to download to the phone so it would already be on the phone... just wondering how I would go about importing it. Thanks
fwaokda
Freshman
Freshman
 
Posts: 8
Joined: Mon Feb 15, 2010 11:07 pm

Top

Postby wally » Wed Mar 31, 2010 3:39 pm

I assume that by "SQL file" you mean a preexisting SQL database. In that case, yes, it is fairly easy. Do you want to do this on the phone itself or do you want to import the SQL using a PC and then put the resultant database on the phone? There are advantages and disadvantages to both. If you want to do the work on the PC, you will have to install SQLite3 onto your PC. Other than that, here is a procedure:

1) Use the "dump" feature of the SQL database (most have this) to dump the database. The dump feature (the actual command may vary from system to system) will create an actual file of SQL commands that will recreate the database when interpreted by the SQLite processor.

2) Feed the resultant text file to the SQLite program (either on the PC or the phone)

The result will be an SQL database with all of the tables that you exported. If you have any specific questions, please let me know.

Hope this helps,

wally
wally
Freshman
Freshman
 
Posts: 2
Joined: Wed Jan 20, 2010 4:00 pm
Location: Youngstown, OH

Top

Return to General

Who is online

Users browsing this forum: No registered users and 6 guests