Keyword error with SQL * Loader and generated control file

I create a control file dynamically when my shell script is run, with:

echo 'LOAD DATA'                             > $CTLDIR/test.ctl
echo 'TRUNCATE'                              >> $CTLDIR/test.ctl
echo 'INTO TABLE TEMP'                       >> $CTLDIR/test.ctl
echo 'FIELDS TERMINATED BY ","'              >> $CTLDIR/test.ctl
echo 'TRAILING NULLCOLS'                     >> $CTLDIR/test.ctl
echo '('                                     >> $CTLDIR/test.ctl
echo 'NO, '                                  >> $CTLDIR/test.ctl
echo 'I_NUM , '                              >> $CTLDIR/test.ctl
echo 'QTY  , '                               >> $CTLDIR/test.ctl
echo 'CREATE_DATETIME       SYSDATE'         >> $CTLDIR/test.ctl
echo ')'                                     >> $CTLDIR/test.ctl

      

When I run my shell script, I get the error "Expected INTO keyword, LOAD keyword found".

Please help me with this issue.

+3


source to share


1 answer


Your control file looks fine. How do you use SQL * Loader?

You can start it with the following command:



sqlldr control=$CTLDIR/test.ctl userid=[username]/[password]@[connect string]

      

0


source







All Articles