Home » Developer & Programmer » Forms » How to restrict input data (oracle9i, WndowsXP)
How to restrict input data [message #355481] Fri, 24 October 2008 06:40 Go to next message
sreejithmenon
Messages: 15
Registered: October 2008
Junior Member
Hi all,
I'm developing an application in Oracle-Forms9i and facing a problem now.

My table is,
CREATE TABLE ABC
   QUESTION VARCHAR2(100),
   ANS_TYPE VARCHAR2(2),
   START_RANGE VARCHAR2(10),
   END_RANGE VARCHAR2(10);


Based on this table I've created a form. The ans_type can take either of the following values from an LOV; AlphaNumeric(AN) and Numeric(NM).
The concept is that when i insert data, if i select NM as ans_type, then values acceptable in start_range and end_range also should be of datatype Numeric. And if i select AN as answer_type, vise versa.

Please show me a way.

Thanks in advance.
Re: How to restrict input data [message #355488 is a reply to message #355481] Fri, 24 October 2008 07:57 Go to previous message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I guess that WHEN-VALIDATE-ITEM triggers on both "start_range" and "end_range" items should check whether the value entered into the item is a number or a character string.

As there's no function like "is_number" or "is_string", you'll have to write one (or both) by yourself. Testing for a number is relatively easy - check what TO_NUMBER returns; if it is a valid number, fine. If not, raise an exception.

A string might then be "everything that is not a number" (possibly).
Previous Topic: How to Get MAC Address within Forms
Next Topic: dynamic selecting checkbox
Goto Forum:
  


Current Time: Thu Feb 13 10:01:00 CST 2025