Re: Like Statement in PL/SQL

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Fri, 18 Aug 2000 22:52:33 +0200
Message-ID: <966631842.27190.0.pluto.d4ee154e_at_news.demon.nl>


WHERE Site_Num Like ' % '|| strNum ;

Hth,

Sybrand Bakker, Oracle DBA

<juzer_at_my-deja.com> wrote in message news:8nk5ir$mn4$1_at_nnrp1.deja.com...
> Hi
> I am starting with PL/SQL and have written a procedure which takes one
> argument of type varchar2.
>
> The argument I pass to the procedure has to be used in a Like Clause of
> the select statement.
>
> Example
> Create Or Replace Procedure Get_Site_Details( strNum VarChar2 )
> AS
> Cursor cTest Is
> SELECT Site_Num, City From Site
> WHERE Site_Num Like ''' || % || strNum || ''';
> ......
> ...
> End Get_Site_Details;
>
> What is the correct syntax to be used since it select statement works
> if I do something like this.
>
> Create Or Replace Procedure Get_Site_Details( strNum VarChar2 )
> AS
> Cursor cTest Is
> SELECT Site_Num, City From Site
> WHERE Site_Num Like '%9803';
> ......
> ...
> End Get_Site_Details;
>
> Any Help will be greatly appreciated, as I am working on a deadline.
>
> Thanks
> Juzer Doriwala
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Fri Aug 18 2000 - 22:52:33 CEST

Original text of this message