Link to home
Start Free TrialLog in
Avatar of gram77
gram77Flag for India

asked on

Sqlldr error

I am not able to load date in format DDMMYYYY into DT column of table abc.

Please help

--Table
CREATE TABLE abc
(
  col1                  VARCHAR2(2),
  col2              VARCHAR2(9),
  col3                  VARCHAR2(2000),
  DT                    DATE
)

-sqlldr control file (abc.ctl)
LOAD DATA
INSERT
INTO TABLE abc
(
col1 position (01:02),
col2 position (03:11),
col3 position (12:1390),
DT "to_date(SYSDATE,'DDMMYYYY')"
)

--load data into abc table
sqlldr $db_login DIRECT=TRUE CONTROL=$cur_dir/abc.ctl DATA=abc.dat LOG=abc.log BAD=abc.bad DISCARD=abc.dsc

Error while loading data as direct path.
SQL*Loader-417: SQL string (on column DT) not allowed in direct path.

Error while loading data under conventional path
Record 1: Rejected - Error on table abc, column DT.
ORA-01858: a non-numeric character was found where a numeric was expected
Avatar of anandmahajan
anandmahajan
Flag of United States of America image

Use something like this :

search_date DATE "MM/DD/YYYY" "
,deleted
,matches
,birthday_start DATE "MM/DD/YYYY"
,birthday_end DATE "MM/DD/YYYY "
,search_id
,date_search_deleted
ASKER CERTIFIED SOLUTION
Avatar of anandmahajan
anandmahajan
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of schwertner
schwertner
Flag of Antarctica image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial