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 Package Level Subtype Problem

Re: PL/SQL Package Level Subtype Problem

From: Vladimir M. Zakharychev <bob--nospam--_at_dynamicpsp.com>
Date: Wed, 17 May 2006 13:14:50 +0400
Message-ID: <e4epic$1a9r$1@hypnos.nordnet.ru>

<rajbrown_at_gmail.com> wrote in message
news:1147799483.845643.217070_at_y43g2000cwc.googlegroups.com...
> Hi, I'm having problems writing a value to a field of a variable which
> is declared as a table subtype. I have a package which declares the
> subtype (in the spec) as follows:
>
> SUBTYPE rec_info IS info%ROWTYPE;
>
> Within the body I declare a variable of type rec_info. I have two
> procedures, one which inputs a variable of the same subtype which then
> gets copied off to a local variable in the package. In the second
> procedure, I want to overwrite some of the fields in the variable with
> values into that procedure:
>
>
> lr_info rec_info;
>
> PROCEDURE p_save (pr_info IN rec_info) IS
> BEGIN
> lr_info := pr_info;
> END;
>
> PROCEDURE p_save (pv_text IN VARCHAR2) IS
> BEGIN
> lr_info.text := rtrim(pv_text);
> END;
>
>
> The first p_save procedure saves the record locally ok and I can see
> values in it when I debug. However the second p_save does not overwrite
> the value in lr_info.text and when I debug it shows me the previous
> value already stored via pr_info. Hard coding a string to overwrite
> lr_info.text does not work either.
>
>

First of all, why SUBtype and not just TYPE? Next question is what version of Oracle? Of what type is REC_INFO.TEXT? Try specifying pv_text as IN REC_INFO.TEXT%TYPE.

-- 
   Vladimir M. Zakharychev
   N-Networks, makers of Dynamic PSP(tm)
   http://www.dynamicpsp.com 
Received on Wed May 17 2006 - 04:14:50 CDT

Original text of this message

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