SQL Language (MOSC)

MOSC Banner

Problem using the '-' character in SQL Query

edited Feb 18, 2010 5:00AM in SQL Language (MOSC) 7 commentsAnswered
 One of our developers is performing the following select in SQLPLUS;

1* select type_number from TABLE1where type_number = '00013/OAZ-002'
SQL> /

no rows selected

SQL> select  type_number from TABLE 1where type_number like '00013/OAZ%' order by type_number;

TYPE_NUMBER
------------------------------
00013/OAZ
00013/OAZ-002

The query isn't returning anything when the string contains a '-' character, though the data can be found when querying using 'LIKE'. Problem is he needs to find the exact  match for the string in order to perform an update on a table. Any ideas why this is happening?

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center