Home » SQL & PL/SQL » SQL & PL/SQL » How to find if a VARCHAR2 variable has contains a numeric data or not
How to find if a VARCHAR2 variable has contains a numeric data or not [message #242781] Tue, 05 June 2007 01:53 Go to next message
checks
Messages: 3
Registered: January 2007
Junior Member
Dear all,
I have a VARCHAR2 variable and i want to find if that variable contains a number or an alphabet. Is there any function or feature in PL/SQL to find this out?PLease help
Regards,
Bye ..
Re: How to find if a VARCHAR2 variable has contains a numeric data or not [message #242788 is a reply to message #242781] Tue, 05 June 2007 02:11 Go to previous messageGo to next message
dhananjay
Messages: 635
Registered: March 2002
Location: Mumbai
Senior Member
hi,

why pl/sql when you could do it in plain sql.something like

select col1 from your_table_name
where regexp_instr(col1,'[0-9]')>0



regards,
Re: How to find if a VARCHAR2 variable has contains a numeric data or not [message #242789 is a reply to message #242781] Tue, 05 June 2007 02:14 Go to previous message
Maaher
Messages: 7062
Registered: December 2001
Senior Member
No. There's no built-in function. But some version information would be helpful. On 10g you could play with REGular EXPressions.

I did a quick search on "numbers" and selected "Subject only". I got this thread that is quite similar.

MHE
Previous Topic: Hi
Next Topic: Complicated Query...Pls help
Goto Forum:
  


Current Time: Tue Dec 06 14:24:49 CST 2016

Total time taken to generate the page: 0.13586 seconds