5 pts.
 Oracle LIKE statement on SQL Server 2005
I'm trying to execute the LIKE statement but it's not displaying  any values



SELECT R_NAME FROM LAWSON.DEPTCODE WHERE (R_NAME LIKE :r_name)





Software/Hardware used:
oracle 10g
ASKED: October 3, 2009  10:14 PM
UPDATED: October 5, 2009  2:49 PM

Answer Wiki:
Hi, Oracle SQL syntax, like most, requires a wild card to accurately use a LIKE % is a wild card that means zero or more characters _ is a wild card that means one (and only one) character col1 LIKE 'ABC%' would search col1 looking for values that start with ABC, whether anything follows or not. WHERE col1 LIKE '%ABC' searches col1 for values that end with ABC, whether anything come before it or not WHERE col1 LIKE '_ABC%' searches for values that have ABC beginning in the second position, whether anything follow or not WHERE col1 LIKE '%ABC%' searches for ABC anywhere in col1 In your case, you will need to have one or more wild cards in your host variable. I hope this helps.
Last Wiki Answer Submitted:  October 5, 2009  2:49 pm  by  Meandyou   5,205 pts.
All Answer Wiki Contributors:  Meandyou   5,205 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

You need to provide more details.
Why did you title your question “Oracle LIKE statement on SQL Server 2005” ? where are you running this command ?
What’s the value you are using for the :r_name bind variable ?

 63,535 pts.