Home » SQL & PL/SQL » SQL & PL/SQL » sqlplus problem with a procedure
sqlplus problem with a procedure [message #210410] Wed, 20 December 2006 12:42 Go to next message
Nau
Messages: 24
Registered: October 2004
Junior Member
Hi,

I'm working with sqlplus and I'm calling a procedure with input and outputs parameters.

This is the procedure:

create or replace procedure PROC_PRU(entpar in varchar2, salpar out varchar2) as
begin
dbms_output.put_line (entpar);
salpar := 'retorno proc';
end PROC_PRU;


This is the call I make from sqlplus and the error I get.

SQL> exec proc_pru('prueba', salpar);

begin proc_pru('prueba', salpar); end;

ORA-06550: línea 1, columna 26:
PLS-00201: el identificador 'SALPAR' se debe declarar
ORA-06550: línea 1, columna 7:
PL/SQL: Statement ignored

I try to declare the identifier salpar by a declare sentence or a define sentences but it doesn't work.

How I have to declare the out parameter of the procedure.

Any advice will be greatly apreciatted.



icon12.gif  Re: sqlplus problem with a procedure [message #210412 is a reply to message #210410] Wed, 20 December 2006 13:13 Go to previous messageGo to next message
ksoule
Messages: 13
Registered: November 2003
Location: Austin, TX
Junior Member
hi,
You can use a bind variable. see the example hereunder.

sqlplus> variable out_xyz varchar2(25);
sqlplus> exec proc_pru('prueba', :out_xyz);
sqlplus> select :out_xyz from dual;


You can also see the help on how to use DEFINE .

Cheers up


Re: sqlplus problem with a procedure [message #210468 is a reply to message #210410] Wed, 20 December 2006 23:42 Go to previous message
rameshuddaraju
Messages: 69
Registered: June 2005
Location: India
Member

To Display value of a variable created in sqlplus we can use print also

SQL > print out_xyz
Previous Topic: sqlplpus Connect behaviour on 10g
Next Topic: Three inner queries in Select Statement
Goto Forum:
  


Current Time: Sun Dec 04 10:57:15 CST 2016

Total time taken to generate the page: 0.04979 seconds