I am on DB2/AIX64 9.5.8
The script is below
When I run this I get error
DB21034E The command was processed as an SQL statement because it was not a valid Command Line Processor command. During SQL processing it returned:
SQL0104N An unexpected token "END-OF-STATEMENT" was found following "D = credit_rows.cai d". Expected tokens may include: "<delim_semicol on>". LINE NUMBER=22. SQLSTATE=42601
Not sure what delimiter should I set to fix this.
Can you please help.
The script is below
Code:
DB=test
SCHEMA=mine
SCRIPT=`basename $0`
. ~/db2profile
db2 -tv +p <<EOQ
UPDATE COMMAND OPTIONS USING s ON;
UPDATE COMMAND OPTIONS USING z ON $PWD/$SCRIPT.$DB.log;
connect to $DB;
Begin Atomic
For credit_rows as
select cacc.CUST_ID as caid
from $SCHEMA.SS_CUSTACC_B cacc
where (cacc.CREDIT_NUM between 950 and 999
or cacc.CREDIT_NUM between 1950 and 1999 )
and cacc.TU_ENABLE_IND = 'Y'
order by cacc.CUST_NUM
Do
update $SCHEMA.SS_CUSTACC_B ca
set ca.CREDIT_NUM = 1
where ca.CUST_ID = credit_rows.caid;
End For;
End
EOQ
DB21034E The command was processed as an SQL statement because it was not a valid Command Line Processor command. During SQL processing it returned:
SQL0104N An unexpected token "END-OF-STATEMENT" was found following "D = credit_rows.cai d". Expected tokens may include: "<delim_semicol on>". LINE NUMBER=22. SQLSTATE=42601
Not sure what delimiter should I set to fix this.
Can you please help.
Comment