shellunixsql-loader

SQL*Loader-350: Syntax error Into Clause syntax failure


I am trying to load default value using sqlloader from a unix box, while my file only contains one column.

Below is my table structure:

CREATE TABLE DATA_LOAD(
        SEQUENCE_NUMBER     NUMBER(15)
                            CONSTRAINT SEQUENCE_NUMBER NOT NULL,
        Account           NUMBER(12)
                            CONSTRAINT Account  NOT NULL,
        SYS_CREATION_DATE         DATE  NOT NULL,
        SYS_UPDATE_DATE          DATE   ,
        OPERATOR_ID  NUMBER(9)  ,
        APP_ID          CHAR(6),
        SERVICE_CODE         CHAR(5) NOT NULL,
        UPDATE_STAMP  NUMBER(4),
        ACCOUNT_TYPE        CHAR(1),
        ACCOUNT_SUB_TYPE    CHAR(1),
        STATUS              VARCHAR2(2),
        OPER_IND     CHAR(1),
        ERROR_REASON        VARCHAR2(240)
)

File will contain only:

123476810

and I am trying to load with

LOAD DATA
INFILE '$INPUT_FILE'
INTO TABLE DATA_LOAD
FIELDS TERMINATED BY '$'
TRAILING NULLCOLS
(
Account,
SEQUENCE_NUMBER default 2,
STATUS default R,
OPER_IND     default N,
SERVICE_CODE  default abcde,     
SYS_CREATION_DATE default to_date(sysdate,'DD-MON-YY')
)

getting this error:

SQL*Loader-350: Syntax error at line 9.
Expecting "," or ")", found "default".
                   SEQUENCE_NUMBER default 2,

Solution

  • Your syntax seems to be wrong. You need to be using CONSTANT

    OPER_IND     CONSTANT "N"