Forms 3.x: validating number fields while querying
From: <dbentolila_at_lempert.com.ar>
Date: 1997/08/25
Message-ID: <872547715.23169_at_dejanews.com>#1/1
Date: 1997/08/25
Message-ID: <872547715.23169_at_dejanews.com>#1/1
Hi,
I'm using forms 3.x and have a problem while querying on fields of type "number".
In Enter-Query mode, when a user wrongly types a letter in a field of type "number" and presses the [EXECUTE QUERY] key, then forms issues the following message:
FRM-40356: Invalid number in example record -
Query not issued
This is OK; but the problem comes when the user types something
like "A%" in a number field. Then Forms does not validate the field
format and issues the query to the database.
The block is based on a very large table, so the query can take a long time, and then retrieve nothing !.
I have solved the problem validating the example value in the PRE-QUERY of the block in the following mode:
DECLARE
pp NUMBER;
BEGIN
pp := TO_NUMBER(:block1.field1); -- the number field
EXCEPTION
when value_error then
message ('Invalid value in example record');
raise form_trigger_failure;
END;
But I'd be greatful if anyone can suggest a more simply method
in order to validating the values at a more general level.
I'm working with the following versions:
RDBMS: 7.1.6.2.1
SQL*Forms: 3.0.16.12.7
Thanks beforehand,
David.
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
Received on Mon Aug 25 1997 - 00:00:00 CEST
