Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: PL/SQL: Operating system variables???
Michael A. Casillas wrote:
> I know how to pass variables INTO PL/SQL using the &1, &2 arguments, but
> how would I pass variables from PL/SQL OUT to the script??
>
> Michael
You can use dbms_output.put_line(...) in pl/sql and shell command 'read' in shell script.
For example:
sqlplus -s <uid>/<pwd> <<! | tail -1l | read line
set feedback off
set serverout on
begin
dbms_output.put_line('Output from pl/sql');
end;
/
!
echo $line
will echo: Output from pl/sql
You can extent this mechanism to get the value from a out variable of a procedure.
declare
out_value varchar(20);
begin
<pl/sql procedure name>(out_value);
dbms_output.put_line(out_value);
end;
Received on Tue Aug 26 1997 - 00:00:00 CDT
![]() |
![]() |