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 Doubt....

Re: PL/SQL Doubt....

From: Brett Carpenter <bcarpent_at_tacticsus.com>
Date: 1997/09/30
Message-ID: <343162C2.5C7E@tacticsus.com>#1/1

Well, you're right about creating a package.

I find the best way to declare "global" types is to create a declarations package containing all your "global" type declarations. For example,

PACKACE declarations IS

	t_test_record IS RECORD (blah...)
	t_test IS TABLE OF t_test_record INDEX BY BINARY INTEGER;

END declarations;

Then, your procedure would contain the following:

PROCEDURE test(v_test declarations.t_test) IS BEGIN
...
END test;

Hope this helps.

Ajay Agrawal wrote:
>
> Hi Gurus,
>
> I want to pass a table of records from one procedure to another. i am
> running PL/SQL 2.3 on Oracle 7.3.
>
> when I try to run this simple procedure
>
> create or replace procedure TEST(v_test t_test)
>
> AS
> i number := 0;
>
> begin
> for i in 1..50 loop
> v_test(i) := i;
> end loop;
>
> end;
>
> It gives me a error saying that t_test must be declared. The only way I
> could do this is to declare the table type in a package header and then
> use them in the package body.
>
> Does anybody has any idea how to declare Global Variables or Types.
>
> Thanks
>
> Ajay Agrawal
> TTU Box 5997
> Cookeville, TN 38505
> Ph: (931) 372 2898(H)
> (931) 372 3341(O)
>
> http://gemini.tntech.edu/~aka8369
>
> ---------------------------------------------------------------
>
> Name: vcard.vcf
> Part 1.2 Type: text/x-vcard
> Encoding: 7bit
> Description: Card for Ajay Agrawal
Received on Tue Sep 30 1997 - 00:00:00 CDT

Original text of this message

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