views:

49

answers:

3

Is there an ability to import fixed width file to oracle? Preferably through .net(c#) for catching errors during import and showing them to user.

P.S. File has 5 types of rows. For example 1 row has 5 columns, 2-nd has 50 columns.

+5  A: 

If you want to use .net/c# then you'll probably need to write your own methods to do it.. but if you want to use standard tools, then SQL*Loader is what you want.

Matthew Watson
File has 5 types of rows. For example 1 row has 5 columns, 2-nd has 50 columns.Will SQL Loader work with it?
Alex Blokha
+5  A: 

If you are able to generate or place the files on the database host (or a file share that the database host can access), you can use Oracle externally-defined tables, which let you use a SQL*Loader-like description of the file to make it appear as a table to the Oracle RDBMS for selects, joins, etc. After the first access to the file, an exceptions file will be generated on the filesystem that contains the errors - you could even bind a second table to this file to show the errors.

The "tables" will be SELECT-only however.

dpbradley
+1 External tables are definitely easier to work with than SQL*Loader, especially if we need to be interactive with a user who is not a DBA.
APC
A: 

http://www.dbforums.com/oracle/958192-oracle-fixed-width-flat-file.html

This will help u..