NULL problem
Posted in 1995
{
Anyone knows how to resolve this ?
If the value of b in the
select * from test where a = b
is a NULL , the select statment will not find anything, even though the
relevent record exists. See example below.
The select works if
select * from test where a is NULL
But, if the value of b is a variable in a 4GL, you can't code everything as
IF b is null then
select statment 1
else
select statment 2
end if
Is this a bug or a feature of 4GL :-)
}
MAIN
DEFINE d DATE
DEFINE m_no,f_no CHAR(12)
DATABASE gis
CREATE TEMP TABLE test
(flight_no CHAR(12),flight_arr_date DATE, mawb_no CHAR(12))INITIALIZE d TO NULL
LET m_no = '1'
LET f_no = 'SQ 1'
INSERT INTO test VALUES (f_no,d,m_no)
CALL test (f_no,d,m_no)
END MAIN
FUNCTION test (f_no,f_date,m_no)
define m_no,f_no CHAR(12)
define f_date DATE
select * from test where flight_no = f_no
and flight_arr_date = f_date and mawb_no = m_no
display status
END FUNCTION
{
----------------------------------
Ti Lian Hwang - DHL Singapore
email : tilh@sin-co.sin-ro.dhl.com
----------------------------------
}