If I run the below script, I am getting the error SP2-0552: Bind variable "OUTRES" not declared. So, how to define the bind variable OUTRES and where to define?
#!/usr/bin/bash
sqlplus -s scott/tiger << EOF
declare ret varchar2(10):= '0';
begin
begin
insert into mytab(col1) values(1);
exception
when others then
ret:=ret||'1';
end;
select ret into :OUTRES from dual;
end;
/
quit
EOF