dbTalk Databases Forums  

Help on Item validation

comp.databases.oracle.tools comp.databases.oracle.tools


Discuss Help on Item validation in the comp.databases.oracle.tools forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
nick048
 
Posts: n/a

Default Help on Item validation - 03-13-2007 , 07:21 AM






Hi to All,

I my form I have 2 Items: FROM_CODE and TO_CODE.
The items are declared as VARCHAR2(18 BYTE) with this visualization
format:
99.99.99.99.999999

I have added a trigger WHEN-VALIDATE_ITEM to Item TO_CODE with this
code:
If :TO_CODE < :FROM_CODE then
begin
DISPLAY_MESSAGE('Code Error', 'From code must be < To code') ;
raise form_trigger_failure;
end;
end if;

For example if FROM_CODE = 00.00.01.03.071767 and TO_CODE =
00.00.01.03.070064, the error message is correctly displayed and the
focus return to Item TO_CODE.

If FROM_CODE = 00.00.01.03.071767 and TO_CODE is null, the trigger
pass as valid the null code.

How can resolve this problem ? I hope that someone can help me.

Thank You and Best Regards
Gaetano


Reply With Quote
  #2  
Old   
DA Morgan
 
Posts: n/a

Default Re: Help on Item validation - 03-13-2007 , 09:22 AM






nick048 wrote:
Quote:
Hi to All,

I my form I have 2 Items: FROM_CODE and TO_CODE.
The items are declared as VARCHAR2(18 BYTE) with this visualization
format:
99.99.99.99.999999

I have added a trigger WHEN-VALIDATE_ITEM to Item TO_CODE with this
code:
If :TO_CODE < :FROM_CODE then
begin
DISPLAY_MESSAGE('Code Error', 'From code must be < To code') ;
raise form_trigger_failure;
end;
end if;

For example if FROM_CODE = 00.00.01.03.071767 and TO_CODE =
00.00.01.03.070064, the error message is correctly displayed and the
focus return to Item TO_CODE.

If FROM_CODE = 00.00.01.03.071767 and TO_CODE is null, the trigger
pass as valid the null code.

How can resolve this problem ? I hope that someone can help me.

Thank You and Best Regards
Gaetano
IF NVL(:TO_CODE, <some_value>) < NVL(:FROM_CODE, <some_value>) THEN

or a variation on the theme.
--
Daniel A. Morgan
University of Washington
damorgan@x.washington.edu
(replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.