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 Meandyou5,205 pts.
If you live outside the United States, by submitting your email address you consent to having your personal data transferred to and processed in the United States.
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 ?
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 ?