Re: How to assign a value to a variable

From: Rama Krishna <ramakrishnadasa_at_yahoo.com>
Date: 23 Oct 2003 04:14:23 -0700
Message-ID: <f8098465.0310230314.b827a9f_at_posting.google.com>


The problem is you have not declared the variable pName.

Regards,
Rama Krishna.

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.
>
>
>
> Daniel Morgan wrote:
>
> > Florian Marinoiu wrote:
> >
> > >Hi,
> > >
> > >I have the following MS-SQL Server statement that I want to convert to
> > >ORACLE 8.1
> > >SET _at_pPhone = '%' + @pPhone + '%'
> > >
> > >In ORACLE I tried
> > >SELECT '%' || pPhone || '%' into pPhone from dual;
> > >
> > >Where pPhone is a parameter that is passed to the procedure.
> > >
> > >How could I do it?
> > >
> > >Is it a set in ORACLE?
> > >
> > >Thanks,
> > >Florian
> > >
> > >
> > >
> > It would be helpful to know what you expect as the result since '%' is a
> > wildcard in Oracle.
> >
> > But to accomplish what you appear to want ...
> >
> > pPhone := '%' || pPhone || '%';
> >
> > And please do not cross-post. One, appropriate, group is enough.
> >
> > --
> > Daniel Morgan
> > http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp
> > http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp
> > damorgan_at_x.washington.edu
> > (replace 'x' with a 'u' to reply)
Received on Thu Oct 23 2003 - 13:14:23 CEST

Original text of this message