Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Like Operator in Oracle 9i

Status
Not open for further replies.

seequal

Technical User
Sep 26, 2005
11
GB
Hi,

I am trying to find a way of evaluating whether the elements of a given string are either numeric or alpha characters

In T/SQL I would simply do the following:-

SELECT * FROM Table
WHERE UPPER(Field) LIKE('[A-Z][0-9][0-9][0-9][A-Z][A-Z]')

Can't seem to find a simple way to replcate this in Oracle 9i.

Can anyone give me a pointer ?

Thanks
 
Code:
SELECT *
FROM   table
WHERE  Translate(Translate(Upper(field),
       'ABCDEFGHIJKLMNOPQRSTUVWXYZ','~~~~~~~~~~~~~~~~~~~~~~~~~~'),
       '0123456789','@@@@@@@@@@') = '~@@@~~';
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top