does anyone know how to do this, for example

Code:
declare 
fec date;
begin
select sysdate
into fec
from dual;
end;
/
I then have to get variable fec to a shell variable
I know how if I do shell variable="" where "" is the whole chunk of above (using EOF)

Code:
#!/bin/ksh

export fec=`sqlplus -s << EOF
loop/loop@loop
set pagesize 0
set feed off
set serveroutput on
variable fec varchar2(20)
begin
select sysdate
into :fec
from dual;
dbms_output.put_line(:fec);
end;
/
exit
EOF`

echo $fec
but is there another cleaner way?

I dunno how :(

[Edited by pando on 11-12-2001 at 07:52 AM]