0

I am trying load the data using in ctl file , But syntax error I am getting ,that is :SQL*Loader-350: Syntax error at line 15. Expecting "," or ")", found keyword by. COS "TRUNC(:COS/32)",TERMINATED BY WHITESPACE following code is my try.

load data
INFILE 'rtd.txt'
INTO TABLE RTD_ATTLAS_TMP
APPEND
FIELDS TERMINATED BY '\|'
(
TRAFFIC_CUST_ID "UPPER(:TRAFFIC_CUST_ID)",
SOURCE_DEV_NAME "UPPER(REGEXP_REPLACE(:SOURCE_DEV_NAME, '\\.\\D+', '', 1,  0))",
DEST_DEV_NAME "UPPER(REGEXP_REPLACE(:DEST_DEV_NAME, '\\.\\D+', '', 1, 0))",
DATE_STAMP boundfiller,
TIME_STAMP "to_date(:DATE_STAMP ||' '|| :TIME_STAMP, 'mm/dd/yyyy   hh24:mi:ss')",
MIN_RTD,
AVG_RTD,
MAX_RTD,
COS "TRUNC(:COS/32)",TERMINATED BY WHITESPACE
)

Here is my file to be loaded 'rtd.txt':

NEW FEEDS TEST|ARAETSBUEAR01H03|172.20.227.220|10/08/2014|00:00:00|159|159|159|104
Chaya
  • 95
  • 3
  • 12
  • SQL*Loader-350: Syntax error at line 15. Expecting "," or ")", found keyword by. COS "TRUNC(:COS/32)",TERMINATED BY WHITESPACE – Chaya Aug 03 '15 at 11:15
  • What effect are you expecting the `,TERMINATED BY WHITESPACE` on line 15 to have? The comma is making it look like a new column called `TERMINATED` at the moment. – Alex Poole Aug 03 '15 at 11:23
  • I want to end the process with WHITESPACE after COS "TRUNC(:COS/32)" column.. – Chaya Aug 03 '15 at 11:27
  • Is there more text after the value you want to interpret as `:COS`, or just a line break? If you just have whitespace up to the end of line as you've shown (or next `|` separator) then you don't need to do anything special. – Alex Poole Aug 03 '15 at 11:36
  • I have changed to COS "TRUNC(:COS/32)" TERMINATED BY WHITESPACE , but same error I am getting, – Chaya Aug 03 '15 at 11:38
  • If I removed "TRUNC(:COS/32)" from above statement , data is inserted properly, but that column value should be TRUNC(:COS/32) – Chaya Aug 03 '15 at 11:40

1 Answers1

0

I have changed this in my code , it is working fine,

COS TERMINATED BY WHITESPACE  "TRUNC(:COS/32)"  
Chaya
  • 95
  • 3
  • 12