ORACLE return a function to Solaris

Guys,

I�m have this problem and I do not know what to do anymore:

cod=`sqlplus -s ${DATABASE} << EOF
set heading off feedback off verify off
select max(eventid) from events;
exit
EOF`

sed "s/CODEVENTID/${cod}/" c.ctl

Abova What I�ve done. The CODEEVENTID is already set into a control file, I need the code that is generated by the Oracle. However the return is

sed: command garbled: s/CODEVENTID/

What can I do?

Regards

Which flavour of Unix is it in ..?

The sed command sort of fails to accept the $cod as a variable. Try single quotes as below:

sed "s/CODEVENTID/${cod}/" c.ctl

replace with

sed 's/CODEVENTID/'"${cod}"'/g' c.ctl

works for me in solaris ....

Hope this helps,
Vj