Like Statement in PL/SQL

From: <juzer_at_my-deja.com>
Date: Fri, 18 Aug 2000 20:16:46 GMT
Message-ID: <8nk5ir$mn4$1_at_nnrp1.deja.com>


Hi
[Quoted] [Quoted] 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:16:46 CEST

Original text of this message