Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: How to call store procedure in SQL*Plus

Re: How to call store procedure in SQL*Plus

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Mon, 26 Apr 1999 12:57:31 GMT
Message-ID: <372d6245.7538059@192.86.155.100>


A copy of this was sent to matthew_so_at_my-dejanews.com (if that email address didn't require changing) On Mon, 26 Apr 1999 12:35:30 GMT, you wrote:

>Hi all,
> I have written a stored procedure in Oracle. [proc(abc in out varchar2)]
>The stored procedure will take the same parameter as in and out. However, how
>can i call the procedure in SQL*PLUS.
>I know that it should call below line
>
>var in_para char(100)
>execute proc(:in_para)
>

var in_para char(100)
exec :in_para :='123'
exec proc(:in_para)
print :in_para

for example:

  1 create or replace procedure proc( x in out char )   2 as
  3 begin
  4 x := '456';
  5* end;
SQL> / Procedure created.

SQL> var in_para char(100)
SQL> exec :in_para :='123'

PL/SQL procedure successfully completed.

SQL> exec proc(:in_para)

PL/SQL procedure successfully completed.

SQL> print :in_para

IN_PARA



456

beware of CHAR unless you understand the blank padded comparision semantics...

>But, how can i assign the value '123' to the in_para??? Just
>in_para:='123'???? Not work!!
>
>Thanks a lot!
>
>-----------== Posted via Deja News, The Discussion Network ==----------
>http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
 

Thomas Kyte
tkyte_at_us.oracle.com
Oracle Service Industries
Reston, VA USA

--
http://govt.us.oracle.com/ -- downloadable utilities  



Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Mon Apr 26 1999 - 07:57:31 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US