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
Messages: 24
Registered: October 2004
Junior Member

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
dbms_output.put_line (entpar);
salpar := 'retorno proc';

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
Messages: 13
Registered: November 2003
Location: Austin, TX
Junior Member
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
Messages: 69
Registered: June 2005
Location: India

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 Oct 23 22:49:46 CDT 2016

Total time taken to generate the page: 0.11627 seconds