Home » Developer & Programmer » Forms » Error in Validation
Error in Validation [message #224727] Thu, 15 March 2007 04:32 Go to next message
nick048
Messages: 36
Registered: February 2006
Member
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. Razz

Best Regards
Gaetano
Re: Error in Validation [message #224745 is a reply to message #224727] Thu, 15 March 2007 05:49 Go to previous message
vamsi kasina
Messages: 2107
Registered: October 2003
Location: Riyadh, Saudi Arabia
Senior Member
select 1 from dual where '00.00.01.03.0100000' > ''
Nothing can be compared with null or ''.
The comparison always gives false only.
By the way I didn't understand the concept of NVL(:FROM_CODE,'')
'' is something like to_char(null).
So, Try something else (may be space ' ' or zero '0' or depends on your business logic).

By
Vamsi
Previous Topic: POST-CHANGE trigger
Next Topic: rename/ format column headings
Goto Forum:
  


Current Time: Thu Dec 08 00:18:50 CST 2016

Total time taken to generate the page: 0.05589 seconds