Home » Developer & Programmer » Forms » validate item on varchar
validate item on varchar [message #206873] Fri, 01 December 2006 20:07 Go to next message
SPRAS881
Messages: 2
Registered: December 2006
Junior Member
hi
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

thanks
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
Littlefoot
Messages: 21818
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
djmartin
Messages: 10181
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

David
Previous Topic: Focus lost navigating forms in web deployment of forms 6i
Next Topic: state where no record match LOV
Goto Forum:
  


Current Time: Fri Sep 20 13:34:02 CDT 2024