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

Home -> Community -> Usenet -> c.d.o.misc -> Re: PL/SQL "table" question...

Re: PL/SQL "table" question...

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: 1997/05/22
Message-ID: <3388a1a2.4292972@newshost>#1/1

On Wed, 21 May 1997 10:18:55 -0500, Vijay Damodaran <vijayd_at_nortel.com> wrote:

>I have created a package as follows:
>
>------------
>/* Package Specification */
>create or replace package Admin as
> type admintab is table of cmn_gpm_admin.admin_empno%type
> not null index by binary_integer;
> function GetAdmin(appln in cmn_gpm_admin.application%type)
> return admintab;
>end Admin;
>

[snip]

>
>The problem is not in the package specs or its body, both
>compile fine. But I am trying to execute this package within
>sqlplus and it is this script which gives the problem. The
>script I use is:
>
>--------
>/* start of SQL*Plus script */
>1 declare
>2 type admtab is table of cmn_gpm_admin.admin_empno%type
>3 not null index by binary_integer;
>4 adm admtab;
>5 begin

[snip]

Once you declared the type, you never should declare it again. The type in the anonymous block might STRUCTURALLY be the same, but it is a brand new, different type.

Do:

declare

   adm Admin.admtab;
begin

   ....
end;

and it'll work.

>

 [snip]
>
>Question1:
>----------
>Does PL/SQL consider the "admtab" declared in the SQL script
>and "admintab" declared in the package to be different
> datatype even though they have the exact same declaration.
[snip]

Yes it does.
Reference the type in the package using PACKAGENAME.TYPE_NAME.

>
>Question2:
>----------
>Are global variable specifications defined in a package stored
>in the SGA on the server? So, when a client application such

stored in the PGA which may or may not be in the SGA but its on the server.

>as Forms45 appln, makes a reference to this global variable,
>is there a call to the server to get the information?
>

Yes

>Thanks for ur replies.
>
>VJ.
>--
>Vijay Damodaran
>vijayd_at_nortel.com
>Work: (972) 685-8150

Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Bethesda MD

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



Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Thu May 22 1997 - 00:00:00 CDT

Original text of this message

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