Re: data to procedure? packed data?

From: Mark D Powell <Mark.Powell2_at_hp.com>
Date: Thu, 11 Nov 2010 05:42:15 -0800 (PST)
Message-ID: <0364c532-3856-4f3b-8568-3419ca79f5cf_at_v20g2000prl.googlegroups.com>



On Nov 11, 4:35 am, jodleren <sonn..._at_hot.ee> wrote:
> Hi all
>
> I need to send data to this thing - and I guess that the
> "selite" (explanation) is an array or something.
> Just how do I do that?
>
> I understand all the parameters, except the first one - and "comment"
> is possible, but the product ID / name an option, as the procedure
> should need to know what to work with.
>
> Any ideas?
>
> Sonnich
>
> procedure VarastopaikkaSiirrot(ppSelite Vararasto_pack.vctable,
> Function VarastoPaikkaSiirrot2(ppJuoksu in pls_integer,
> ppPaikat in Vararasto_pack.intTable,
> ppPaikka in pls_integer,
> ppMuutos Vararasto_pack.floatTable,
> ppMuutos in number,
> ppTyyppi in char default 'S'
> ppTyyppi in char,
> ) is
> ppSelite in varchar2) return pls_integer is

In order to pass a pl/sql table (array) to a stored procedure you first need to declare the collection in the caller. If Vararasto_pack is a package specification then the definition can be found there. Depending on what procedure VarastopaikkaSirrot does you may need to populate the collection before making the call.

Here is an example that declares the pl/sql table of a record type defined previously followed by a procedure definition that uses the array:

  • record layout for plsql tbl to hold new tblspc names type r_ats is record ( tablespace_name varchar2(15) ,extent_sz number ,extents_avail number ,extents_used number ,is_tbl v_is_tbl%type ,is_mme v_is_mme%type ,is_lg v_is_lg%type ,is_spec v_is_spec%type ) ; -- type t_atsr is table of r_ats index by binary_integer ; t_ats t_atsr ; -- alloc plsql tbl 4 new tblspc data t_empty t_atsr ; -- empty tbl 2 allow freeing mem during testing --
  • procedure to load ats -- procedure ats_ld( p_ats in out t_ats%type ) is -- I binary_integer ; <snip>

HTH -- Mark D Powell -- Received on Thu Nov 11 2010 - 07:42:15 CST

Original text of this message