Hi All,
We have new line characters in the csv that we want to load to an Oracle table. Hence, we had used 'replace' function in the control file of sql loader. However oracle external table is not allowing me to use 'replace' function while creating the table. I'm using 11g, please suggest a solution.
Regards,
KK
External table script whih is giving issues:
CREATE TABLE ikncu.cont_ext (
CONTACTID CHAR %REPLACE(:CONTACTID,CHR(13)||CHR(10),' ')%
)
ORGANIZATION EXTERNAL (
TYPE oracle_loader
DEFAULT DIRECTORY timezdif_dir
ACCESS PARAMETERS (
RECORDS DELIMITED BY NEWLINE
FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '"'
MISSING FIELD VALUES ARE NULL
)
LOCATION ('file.csv')
)
REJECT LIMIT UNLIMITED;
{code}
Sql loader control file sample.
{code}
LOAD DATA
APPEND
INTO TABLE my table
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\"'
TRAILING NULLCOLS
(
CONTACTID CHAR %REPLACE(:CONTACTID,CHR(13)||CHR(10),' ')%,
ACCOUNT_NAME CHAR %REPLACE(:ACCOUNT_NAME,CHR(13)||CHR(10),' ')%
)" |tr '\%' '\"' >my_control_file.ctl