Re: Help SQL and database Package variables

From: Roland Schaar <rschaar_at_gosch.com>
Date: Fri, 17 Sep 1999 08:39:47 +0100
Message-ID: <37E1F043.506B6193_at_gosch.com>


I think you should use eighter a function to return values or use a procedure with out-parameters. But never just try to read local variables of a package. And you have to do something with the return values. You could assign them to variables in an PL/SQL Block or use the function in a select statement. Do not think procedural in SQL. It just works in PL/SQL.

roland schaar
gosch consulting gmbh

StarFighter wrote:

 Suppose we have a package  like this______________________________________Create Or Replace Package dummy As-- Variablesx  Varchar2(10);y Number(10,2); Function fun_dummy Return Boolean;End dummy; Create Or Replace Package Body dummy AsFunction fun_dummy Return Boolean;Begin Return(True);End fun_dummy;Begin   dummy.y = 1999.99;End dummy;_______________________________________ Then try to assign value to x byexecuting in SQL Plus SQL> exec dummy.x := 'Help me!'; Still, everything works fine! But now, how to find out value of x or yjust using SQL Plus?I tried:SQL>Select dummy.x From Dual;        ORA-00904: invalid column name I tried making procedures which in their exceptions were raising values of x or ySQL> exec get_value('X');         ORA-20900: Help me!
         ORA-06512: at "SCOTT.GET_VALUE", line 8
         ORA-06512: at line 2Or:SQL> exec get_value('Y');         ORA-20900: 1999.99
         ORA-06512: at "SCOTT.GET_VALUE", line 8
         ORA-06512: at line 2This works fine, but suppose we have a hundred of variables in hundred of packages!!! PLEASE HELLLLLPPPPP!!                                                 StarFighter
Received on Fri Sep 17 1999 - 09:39:47 CEST

Original text of this message