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: Pl/SQL using procedure builder, How do you test call procedures?

Re: Pl/SQL using procedure builder, How do you test call procedures?

From: Steve Phelan <stevep_at_XXnospamXX.toneline.demon.co.uk>
Date: 1998/03/04
Message-ID: <889002553.6877.0.nnrp-04.c2de712e@news.demon.co.uk>#1/1

Write a 'dummy' anonymous PL/SQL block and declare the variables in it (use the DECLARE keyword when you open the block). Call your procedure from within this block, and print out the return values with DBMS_OUTPUT.PUT_LINE. DECLARE

  myvar NUMBER(10);
BEGIN

  myproc(myvar);
  DBMS_OUTPUT.PUTLINE(myvar);
END; Run it through SQLplus, etc. Don't forget to first 'set serverout on'.

Steve Phelan.

fvali wrote in message <34FC7850.4A46_at_biotrack.com>...
>Heya,
> Do any of you know how i would be able to test a procedure call that
>requires some OUT variables?
>So for example:
>
>Within a package i have the following procedure defined:
>
>procedure get_user_info( user_num IN Number, user_name OUT varchar2,
> user_address OUT varchar2 );
>
>Now from my PL/SQL prompt I would like to call this procedure.
>If the procedure's parameters are all IN variables i ahve no problem in
>calling it, but when they are OUT variables the environment won;t let
>me.
>
>Is there anyway i can declare global/bind variables as such:
> .create varchar2 g_name;
> .create varchar2 g_address;
>then
> get_user_info( 2, g_name, g_address );
>which would then store the info in the two bind variables?
>
>Also then how would i examine the data in those variables?
>
>I tried the above tactic, and i got the error that g_name and g_address
>are not in scope, so I was hoping I did something wrong...
>Any help will be greatly appreciated.
>-gracias
>-fais
>
>
>--
>Biometric Applications & Technology
>Faisal Vali - Software Engineer (B.A.T man)
Received on Wed Mar 04 1998 - 00:00:00 CST

Original text of this message

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