Home » Developer & Programmer » Forms » Comparing cursor with null values to Dev2k Forms control
Comparing cursor with null values to Dev2k Forms control [message #77841] Sat, 01 December 2001 18:07 Go to next message
Mark Johnson
Messages: 5
Registered: August 1999
Junior Member
I have a procedure used to compare certain values to form controls. However, if the value in the cursor row is NULL, then no comparison seems to be done against the Dev2k Forms control. If the row value is not null, it will always perform a comparison though. My code essentially is basically like this:
IF :blk.fld != somerow.fld THEN...
Is there any simple way around this?

----------------------------------------------------------------------
Re: Comparing cursor with null values to Dev2k Forms control [message #77847 is a reply to message #77841] Mon, 03 December 2001 22:39 Go to previous messageGo to next message
Seethalakshmi
Messages: 1
Registered: December 2001
Junior Member
Mark,

Null cannot be compared. If it is compared it'll always return the boolean value False.
Use
IF :blk.fld != NVL(somerow.fld,'###') THEN...

NVL is used to replace NULL value with some other value to make the comparison work. When somerow.fld is NULL, then that will be replaced with ###(you can give any non-existing value).

Regards
Seetha

----------------------------------------------------------------------
Re: Comparing cursor with null values to Dev2k Forms control [message #77860 is a reply to message #77841] Tue, 04 December 2001 16:40 Go to previous message
waris
Messages: 115
Registered: November 2001
Senior Member
Hi Mark...

yep, there is a simple way...

if nvl(:blk.fld,0)<>nvl(somerow.fld,0) then
----

i hope this gets u going.....

Cheers
waris

----------------------------------------------------------------------
Previous Topic: Advanced printing of Reports
Next Topic: Re: free material for oracle
Goto Forum:
  


Current Time: Thu Apr 25 16:50:49 CDT 2024