I want to create an external table in an Oracle database by extracting its data from a flat file on the server. The format of this file is non-trivial. Each line in this file can be one of several different layouts, depending on the line prefix (the prefix itself is always a fixed length). For example, a line starting with 'TYPE1' will have a different layout than a line starting with 'TYPE2' .
I read that external tables can take advantage of all the constructs available for SQLLoader control files. However, in any documentation that I read only seams, you are dealing with trivial flat file formats in which all lines have a common layout. The SQLLoader control file can easily handle this scenario with the WHEN clause:
WHEN (1:5) = 'TYPE1' ( field1 POSITION(10:18), field2 POSITION(26:35) ) WHEN (1:5) = 'TYPE2' ( field1 POSITION(23:27), field2 POSITION(15:19) )
How can I express such a layout using the syntax for defining an external Oracle table?
oracle external sql-loader
Adam paynter
source share