dbTalk Databases Forums  

Error of validation

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


Discuss Error of validation in the comp.databases.oracle.tools forum.



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

Default Error of validation - 03-15-2007 , 03:27 AM






Hi to All,

I a Form I have 2 Item 'FROM_CODE' AND 'TO_CODE'. Both are
VARCHAR2(18) with a format 99.99.99.99.999999.
For the Item TO_CODE I have the WHEN-VALIDATE-ITEM trigger:

If (NVL(:TO_CODE,'') < NVL(:FROM_CODE,'')) then
begin
DISPLAY_MSG('Code Error', 'To code muts be > From code') ;
raise form_trigger_failure;
end;
end if;

For example, if From code = '00.00.01.03.0100000' and To code =
'00.00.01.03.001000' the trigger work fine.

If From code = '00.00.01.03.0100000' and in To code NO VALUE, the
trigger don't return the error message.

How can resolve this problem ? I hope in Your help.

Best Regards


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

Default Re: Error of validation - 03-15-2007 , 09:31 AM






nick048 wrote:
Quote:
Hi to All,

I a Form I have 2 Item 'FROM_CODE' AND 'TO_CODE'. Both are
VARCHAR2(18) with a format 99.99.99.99.999999.
For the Item TO_CODE I have the WHEN-VALIDATE-ITEM trigger:

If (NVL(:TO_CODE,'') < NVL(:FROM_CODE,'')) then
begin
DISPLAY_MSG('Code Error', 'To code muts be > From code') ;
raise form_trigger_failure;
end;
end if;

For example, if From code = '00.00.01.03.0100000' and To code =
'00.00.01.03.001000' the trigger work fine.

If From code = '00.00.01.03.0100000' and in To code NO VALUE, the
trigger don't return the error message.

How can resolve this problem ? I hope in Your help.

Best Regards
What is the business rule? If there must be a TO_CODE then
REQUIRED in the property palette should be "Yes."
--
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
  #3  
Old   
Gerard H. Pille
 
Posts: n/a

Default Re: Error of validation - 03-17-2007 , 04:54 AM



DA Morgan wrote:
Quote:
nick048 wrote:

Hi to All,

I a Form I have 2 Item 'FROM_CODE' AND 'TO_CODE'. Both are
VARCHAR2(18) with a format 99.99.99.99.999999.
For the Item TO_CODE I have the WHEN-VALIDATE-ITEM trigger:

If (NVL(:TO_CODE,'') < NVL(:FROM_CODE,'')) then
begin
DISPLAY_MSG('Code Error', 'To code muts be > From code') ;
raise form_trigger_failure;
end;
end if;

For example, if From code = '00.00.01.03.0100000' and To code =
'00.00.01.03.001000' the trigger work fine.

If From code = '00.00.01.03.0100000' and in To code NO VALUE, the
trigger don't return the error message.

How can resolve this problem ? I hope in Your help.

Best Regards


What is the business rule? If there must be a TO_CODE then
REQUIRED in the property palette should be "Yes."
Your nvl is useless, when one of the codes is null you replace it with null.

?????

This can be avoided by following our District Attorney's advice, but if you really want it in code:

if :to_code < :from_code
or :to_code is not null and :from_code is null

If you don't understand how null works, you'll have trouble with using :from_code further on in
your code.

Gerard


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.