iPhone Note #8: Exporting Oracle to SQLite3
Since I’ve been working most of my time with iPhone Dev for the last couple of months, I thought it will be worthwile to post how to import files to SQLite3. In a nutshell, use MesaSQLite’s IMPORT function. It will save you a lot of time. Now it is up to you how to export into a CSV or TAB delimited file. For Oracle, I used SQLDeveloper. For other databases, such as MySQL or Postgres, I’ve used Navicat.
- Using SQLDeveloper -> Right Click on the Table from the left pane -> Export
- Choose TEXT since we are going to use that when importing using MesaSQLite. Note, SQLDeveloper does not export CLOB columns. You need to change your column from CLOB to VARCHAR. A workaround is to add a column and then update that column aferwards.
ALTER TABLE poi ADD en_desc VARCHAR(2000); UPDATE poi SET en_desc = en_short_desc;
- In MesaSQLite, FILE -> IMPORT -> CSV/TAB
-
Choose the table which you want to import.
-
Choose your exported TAB delimited file from SQLDeveloper.
-
Afterwards, map the corresponding fields to your database. Note, that I added an extra column “dummy” in the file because it seems I can only match n-1 columns, thus the extra column.