My requirement is :
We are calling an sql statement from a UNIX session, and fetching data into some variables from a table .. now we are unable to access these variables from outside the SQL part. Please let me know how can I achieve this.
Can you please share a code snippet which elucidates this.
from pl/sql you can do something like this, i'm not sure if will work with non numeric values [ but you can try ] i use this to pass exit status if sql failed.
sample.sql
variable status number;
declare
status number;
begin
:status:=2;
end;
/
column status new_value status noprint
select :status status from dual;
exit &status