Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: PL/SQL Package Level Subtype Problem
<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.comReceived on Wed May 17 2006 - 04:14:50 CDT