Search code examples
.netoracle-databaseimportfixed

Import fixed width file to oracle


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.


Solution

  • 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.