Home » Developer & Programmer » Forms » validate item on varchar
validate item on varchar [message #206873] Fri, 01 December 2006 20:07 Go to next message
Messages: 2
Registered: December 2006
Junior Member
i have a column drug_dosage with datatype varchar, i want to include a validate item for the number in the data so that it cant be <= 0,
i tried to use the rtrim as suggested in previous replies of this forum its working but not properly like
if i have inputs
100 ml
1 per day
10 ml
its trimming 'ml' and 'day' but leaving behind 'per'
how can i make it take only number so that i can validate it

Re: validate item on varchar [message #206917 is a reply to message #206873] Sat, 02 December 2006 04:31 Go to previous messageGo to next message
Messages: 21148
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
If numbers are always at the beginning and there's always at least one space behind it, use INSTR function which will search for a space; use this value in SUBSTR function to fetch only numeric value.
Re: validate item on varchar [message #207042 is a reply to message #206873] Mon, 04 December 2006 00:30 Go to previous message
Messages: 10180
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Next time please show the code that you are using.

Put a 'space' in the character list of the 'rtrim'. See http://www.orafaq.com/forum/m/173919/67467/?srch=rtrim#msg_173919

Next Topic: state where no record match LOV
Goto Forum:

Current Time: Sat Aug 19 22:58:48 CDT 2017

Total time taken to generate the page: 0.23699 seconds