We have an unconvential input file. It looks something like the following, with 3 columns
123456 This is a description STATIC
123457 This is a different description DYNAMIC
123457 And even another description BOTH
The problem lies in the fact that spaces separate the columns, as well as exist in the 'description'.
Now, it's easy enough to just pull in the data as one column in an EXTERNAL TABLE, and then run a SUBSTR( ) against the data to pull everything apart, but that means either a VIEW, or some PL/SQL.
Is there anyway to add something like the following into the EXTERNAL TABLE def'n itself?
COL1 = SUBSTR(row, 1, first space)
COL2 = SUBSTR(row, first space + 1, position of last space - position of first space - 1)
COL3 = SUBSTR(row, last space + 1)
I can write this pseudocode as proper SQL, but I don't know how to add it to the table def'n. Alll the examples I've seen so far format incoming date data, like
...
ORGANIZATION EXTERNAL
( TYPE ORACLE_LOADER
DEFAULT DIRECTORY EDS_DATA_DIR
ACCESS PARAMETERS
( records delimited by newline
nobadfile nologfile nodiscardfile
fields terminated by '|'
missing field values are null
reject rows with all null fields
(
TK,
CIT_NO,
CONTEST_DT DATE "YYYY/MM/DD"
NULLIF ( CONTEST_DT = BLANKS ),
...
but nothing resembles what I need.
Thanks,
--=Chuck