Skip to main content
Question

Checking Whether Field Is Digit only or Having special Characters

  • December 15, 2023
  • 1 reply
  • 90 views

haritha.waidyaratne
Sidekick
Forum|alt.badge.img+5

Hello,

I found these pretty useful -

REGEXP_LIKE([num field], '^[[:digit:]]+$')      -- Checks whether the concerned value/column contains digits only

REGEXP_INSTR(SUBSTR([no special characters], '[^a-z^A-Z^0-9]') = 0      -- Checks whether the concerned value/column contains NO special characters (note the return value; greater than zero if special char found.

»
sql - How can you tell if a value is not numeric in Oracle? - Stack Overflow

OraFAQ Forum: SQL & PL/SQL » How do I find special characters using a regular expresion?

Thank you and enjoy.

JJäthing
Hero (Partner)
Forum|alt.badge.img+11
  • Hero (Partner)
  • December 20, 2023

Hi Haritha,

I once learned a way to find special characters in an IFS APPS window using the SQL code shown below. The case description is:

Someone created an object item with the ID ‘M60%E’. In this case the use of the %-character makes the specific item impossible to query for since that is a wildcard character.

The method to find items with such a character is by using an ‘ESCAPE’ command in the where clause:

OBJECT_ID LIKE '%@%%' ESCAPE'@'

...where the @ character can be just any key. The ‘%’ directly after the ‘@’ is the character in the table you want to identify.

It doesn’t seem the system allows you to enter more than one ESCAPE at a time.

OBJECT_ID LIKE '%@%%' ESCAPE'@'

OBJECT_ID LIKE '%@_%' ESCAPE'@'

And it does not allow for finding semicolons.

Sincerely

Jonas


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings