0
我有動態控制文件,如下在外殼腳本SQLLDR誤差optionaly通過封閉「'
`echo 'LOAD DATA' >> $CTL_DIR/tjx_sc_req_upld.ctl
echo 'APPEND' >> $CTL_DIR/tjx_sc_req_upld.ctl
echo 'INTO TABLE TJX_SCR_UPLOAD_HEADER' >> $CTL_DIR/tjx_sc_req_upld.ctl
echo 'WHEN FILE_RECORD_DESCRIPTOR = ' \'FHEAD\' >> $CTL_DIR/tjx_sc_req_upld.ctl
echo 'FIELDS TERMINATED BY ","' >> $CTL_DIR/tjx_sc_req_upld.ctl
echo 'TRAILING NULLCOLS' >> $CTL_DIR/tjx_sc_req_upld.ctl
echo '(' >> $CTL_DIR/tjx_sc_req_upld.ctl
echo 'FILE_RECORD_DESCRIPTOR position(1),' >> $CTL_DIR/tjx_sc_req_upld.ctl
echo 'LINE_NO FILLER,' >> $CTL_DIR/tjx_sc_req_upld.ctl
echo 'SCHEDULE_NO ,' >> $CTL_DIR/tjx_sc_req_upld.ctl
echo 'SCHEDULE_DATE_TIME date' \'YYYYMMDD\' ',' >> $CTL_DIR/tjx_sc_req_upld.ctl
echo 'UPLD_TIME_STAMP sysdate,' >> $CTL_DIR/tjx_sc_req_upld.ctl
echo 'SEQ_NO "' ${exec_seq} '",' >> $CTL_DIR/tjx_sc_req_upld.ctl
echo 'FILENAME CONSTANT ' \'$FILENAME\' ',' >> $CTL_DIR/tjx_sc_req_upld.ctl
echo 'STATUS CONSTANT "UPLOADED"' >> $CTL_DIR/tjx_sc_req_upld.ctl
echo ')' >> $CTL_DIR/tjx_sc_req_upld.ctl`
與上述代碼的外殼腳本也工作fine.But當我下添加到OPTIONALLY ENCLOSED BY '"'
fields terminated by
如下所示
echo 'FIELDS TERMINATED BY "," OPTIONALLY ENCLOSED BY '"' ' >> $CTL_DIR/tjx_sc_req_upld.ctl
我得到語法錯誤
./tjx_sc_req_upld.ksh: line 109: syntax error at line 216: `(`' unexpected
當我刪除可選封閉我不會得到錯誤。
請幫幫我