string format [message #668459] |
Mon, 26 February 2018 06:45 |
|
suji6281
Messages: 145 Registered: September 2014
|
Senior Member |
|
|
Hi Team,
How to check the format of string values.
Assume table has two rows with below values
45-896712
265-89-4578
now, i want to compare these string values are in 99-999999 or 999-99-9999 format or not.
Please help me with your suggestions.
Thank you.
Regards
sekhar
|
|
|
|
|
Re: string format [message #668465 is a reply to message #668461] |
Mon, 26 February 2018 10:08 |
Bill B
Messages: 1971 Registered: December 2004
|
Senior Member |
|
|
1 select 'yes'
2 from dual
3* where regexp_like('45-896712','^\d{2}-\d{6}$')
>/
'YE
---
yes
1 select 'yes'
2 from dual
3* where regexp_like('265-89-4578','^\d{3}-\d{2}-\d{4}>/
'YE
---
yes
[Updated on: Mon, 26 February 2018 10:10] Report message to a moderator
|
|
|