I am trying to get the Srcreccnt and Tgtreccnt from unix files and update the oracle table.
But i get the below error:
ERROR at line 1:
ORA-00936: missing expression
update velocity_process_control set SOURCE_RECORD_COUNT=,SOURCE_RECORD_COUNT= where batch_id=
*
ERROR at line 1:
ORA-00936: missing expression
Can you help me where i doing wrong in capturin the values into unix variables and passing to Oracle.
Srcreccnt=cat `ls ${SOURCE_DIR}/ATRPU_RP_ATU_*.csv | head -1`|wc-l
Tgtreccnt=cat `ls ${IMF_TARGET_DIR}/IMF_ATRPU_*.csv | tail -1`|wc-l
echo "Source record count is ${Srcreccnt}"
echo "Source record count is ${Tgtreccnt}"
sqlplus -S core/core@cptest <<EOF
set feedback off
set head off
update velocity_process_control set SOURCE_RECORD_COUNT=${Srcreccnt},SOURCE_RECORD_COUNT=${Tgtreccnt} where batch_id=
(select batch_id from velocity_process_control
minus
select batch_id from velocity_process_control
where rownum < (select count(*) from velocity_process_control))
;
/
EOF
Srcreccnt=`cat ls ${SOURCE_DIR}/ATRPU_RP_ATU_*.csv | head -1 |wc -l`
Tgtreccnt=`cat ls ${IMF_TARGET_DIR}/IMF_ATRPU_*.csv | tail -1 |wc -l`
the characters ` enclosing the sentence
But now I'm confused, because when you use tail and head you only display 1 line, and wc always will result in 1. Is this ok? Can you explain a little bit more?