Link to home
Start Free TrialLog in
Avatar of MarkJulie
MarkJulieFlag for United States of America

asked on

Export FileMaker data to Oracle SQL db

I have a large FM DB with text, number, date, and timestamp fields that I need to export and upload to an Oracle SQL db. I normally do a small subset upload by exporting a csv file from FM, replacing ',' separators with '|' (comma to pipe delimiter), then upload a pipe-delimited text file to Oracle. The larger complete FBDB has several fields that are composed of strings of five alphanumeric codes each preceded by a comma that must maintain their original format (similar to a concatenated string of 10 ZIP codes with a comma delimiter and the first term preceded also by a comma). Thus, doing a search and replace of all commas with pipes is not feasible.

On the Oracle side, I can either upload a text file or use SQL Developer to write an INSERT or APPEND query.

What is the most suitable FM output?

What is a sample SQL INSERT query for LastName (text/varchar2), Age (number), DOB (date), and ArrivalTime (timestamp) into a schema Oracle::Demographics?
Avatar of sshah254
sshah254

ODBC, XML - both are options.

Retrieve via ODBC and then you can do whatever.

XML - XSLT - do whatever with the exported data and then import into Oracle.

Ss
Avatar of MarkJulie

ASKER

The partial answer appears to be export FM to ODBC or XML. The meat of the question remains, i.e., please provide baby steps for the Oracle upload.

1) Describe the type of file your answer will create with the exported FM data.

2) Write a sample SQL INSERT query for LastName (text/varchar2), Age (number), DOB (date), and ArrivalTime (timestamp) into a schema Oracle::Demographics given the FM data file in 1) above.

3) If your answer chooses not to use a SQL INSERT for uploading to Oracle, please give detailed advice on data manipulation for upload with an open source tool.

Mark

Avatar of North2Alaska
INSERT INTO DEMOGRAPHICS ( LastName, Age, DOB, ArrivalTime )
VALUES (....,  ...., .....)

Is this what you are talking about?

I do a fair amount of Oracle work and I use a tool called TOAD by Quest Software, http://www.quest.com/toad-for-oracle/.  They even have a SQL Server and MySQL version.  I find it an invaluable tool.  I could see creating an ODBC connect to both FM and Oracle and then simple insert into one table from the other table.  Might work.
Correct on the INSERT except that I will want the VALUES to be read from a file of a few dozen records and 198 fields on a monthly basis.

I know about TOAD for powerusers. For me, SQL Developer from Oracle is adequate, but I am not fluent in SQL other than with select, where, and order by. Reading from an external file presents an added level of complexity beyond my skill set, but I can modify a simple template with all the data types.

I will try the ODBC angle in the future when I have more time.
ASKER CERTIFIED SOLUTION
Avatar of North2Alaska
North2Alaska
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SQL Loader at a glance looks Windows friendly, but I am on Snow Leopard. The Unix side looks like I would have to learn a lot of command line. Is there another solution available without the steep learning curve?

How would you write your INSERT using an external data file in a text editor level SQL tool if the external file is in: /home/demographics.dat?
I don't think you can say "Insert into from file".  You will need something to open and interpret the file.  This is what a tool like SQL Loader will do.  But you could also use perl, PHP, Java, etc...  You could also use FileMaker to write the file as a SQL command file with the Insert statements already constructed, but with large number of rows it is terribly inefficient.  But you said you were doing a couple hundred a month, it might not be too bad.
I haven't tried this approach yet, but if I have select, insert, and delete privileges in the Oracle staging schema and set up the relationship in FMPA to allow creation and deletion of records in the Oracle table, can I create a shadow table in FMPA, export the 200 records from the .fp7 file, then import to the shadow table in Oracle with my ODBC connection?
The explanation of the solution was easy to follow, but the tool has a steeper learning curve than I have time to implement. That has no reflection on the solution itself.