|
From: Pawels <p_s...@po...> - 2003-09-03 06:24:41
|
1. Firebird 1.5.rc5
2. There is table in the database
CREATE TABLE NRDANYCH (
NR_ID INTEGER NOT NULL,
NRTYP varchar(3),
NRSYMBOL VARCHAR(6),
NRROK INTEGER,
NRGRUPAMAT SMALLINT,
NRDNOWY INTEGER
);
3. There is one record in the table
(1,'ZLC',null,2003,null,1)
4. Query from console (ibexpert):
SELECT COUNT(nrtyp)
FROM NRDANYCH
WHERE NRTYP=:ITYP AND NRSYMBOL=:ISYMBOL AND NRROK=:IROK AND NRGRUPAMAT
=:IGRUPA
with parameters ='ZLC', isymbol=null, irok=2003, igrupa=null
returns 1
5. The same query inserted into procedure
SELECT COUNT(nrtyp)
FROM NRDANYCH
WHERE NRTYP=:ITYP AND NRSYMBOL=:ISYMBOL AND NRROK=:IROK AND NRGRUPAMAT
=:IGRUPA
INTO :NUMER;
with identical parameters ityp='ZLC', isymbol=null, irok=2003, igrupa=null
returns 0 (sic!) independent of real number of records in the table
Czy kto¶ mo¿ wyja¶niæ dlaczego tak siê dzieje?
6. Wszystko dzia³a ok, je¿eli w rekordzie s± zapisy zamiast null-i (np.
wpisane zera) i parametry zapytania s±
analogicznie ustawione.
6. There is no problem (the query returns real number of records) if there
is no null values
in the record and parameters (for example set as 0)
7. The same behaviour observed in FB 1.0
Regards
Pawel Swierzko
|