I've an error that I don't understand, it seems that that the problem is that my parameters into the shell are not of the same type as what they are in my SQL Database.
For a better understanding: I've a file doc.lst where i've three important things on each line seperated by spaces and i want to use this things as parameter for an UPDATE in my database. Every line will be readen, every part will be used as a parameter and will update my database.
I've a SQL query that is :
UPDATE PE P
SET P.DATED='&1', P.DATEF='&1', P.CODA='&3', P.CODB='&2'
WHERE P.G_BAT=1;
COMMIT;
And a shell that is :
IFS=$'\n'
for i in $(cat $LST_HOME/doc.lst)
do
sqlplus64 $User/$Pass@$ORACLE_SID << EOF
P1=$(echo $i | awk '{print $1}')
P2=$(echo $i | awk '{print $2}')
P3=$(echo $i | awk '{print $3}')
@$SQL_HOME/update_p.sql $P1 $P2 $P3
commit;
exit
/data/jdk1.6.0_XX/bin/java -cp fr.bla.bla.bla
EOF
I've got this error :
SQL> SP2-0734: unknown command at the beggining of "P1=12/03/2..." - end of the line is ignored.
SQL> SP2-0042: unknown command "P2=0" - end of the line is ignored..
SQL> SP2-0042: unknown command "P3=FSL" - end of the line is ignored..
I don't really understand where and how i've to make modifications.