Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: How to assign a value to a variable
"Florian Marinoiu" <x_at_x.com> wrote in message
news:3F9717E9.9B580851_at_x.com...
> Here is the code for the packages that I use
>
> CREATE OR REPLACE PACKAGE "CDMVWEB"."TEST_PCKG"
> IS
> TYPE curTestSelect is ref cursor;
>
> procedure STTESTSELECT (pPhone IN VARCHAR2 default null,
> p_rc out curTestSelect);
>
>
> end
> ;
>
>
> And for the Body
>
>
>
> CREATE OR REPLACE PACKAGE BODY "CDMVWEB"."TEST_PCKG"
> AS
>
> procedure STTESTSELECT (pPhone IN VARCHAR2 default null,
> p_rc out curTestSelect)
>
> IS
>
> BEGIN
>
>
> -- pName := '%' || pName || '%';
>
> OPEN p_rc FOR
> SELECT * FROM DUAL;
>
> exception
> when others then
> raise;
> END;
>
> end TEST_PCKG;
>
> As you can see I put the incriminated line in comments. If it stays like
> this my package is valid if I uncomment it becomes invalid.
Florian,
I can see a couple of problems.
First the variable pName doesn't exist so you can't assign it a value.
If you really meant to use the IN parameter pPhone rather than pName then you will find that Oracle won't allow you to change the value if an IN parameter, only an OUT or IN OUT parameter.
Paul Dixon Received on Thu Oct 23 2003 - 03:49:44 CDT
![]() |
![]() |