Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> How to use variable in the LIKE function along with % operators

How to use variable in the LIKE function along with % operators

From: <sangu_rao_at_yahoo.co.in>
Date: 26 Nov 2006 23:46:50 -0800
Message-ID: <1164613610.617743.218690@h54g2000cwb.googlegroups.com>


Hi,
Is there any way i can use the variable in the Like function. That means i have query like

SELECT * FROM Device WHERE DeviceName LIKE %v_MediaName%;

Here "v_MediaName" is the userdefined variable which contains string. I want to retrieve all the records from the "DEVICE" table whose DeviceName LIKE %v_MediaName%;

If i put it in a single quotes '%v_MediaName%' then the v_MediaName will be treaded as a string instead of a variable. I am using this query in a Procedure.

please help me out to resolve the issue.

thanks
Rao Received on Mon Nov 27 2006 - 01:46:50 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US