Hi people!
Look this (Test in FB 2.0 RC4 with IBExpert):
------------------------------------------------------------------------------------------
CREATE TABLE TEST (MYDATE DATE NOT NULL PRIMARY KEY);
COMMIT;
INSERT INTO TEST VALUES (CURRENT_DATE);
INSERT INTO TEST VALUES (CURRENT_DATE + 1);
INSERT INTO TEST VALUES (CURRENT_DATE + 2);
INSERT INTO TEST VALUES (CURRENT_DATE + 3);
COMMIT;
-- This expression fails
SELECT * FROM TEST WHERE MYDATE + CAST(:days AS INTEGER) >= :dateparam;
--Error:
--Dynamic SQL Error.
--SQL error code = -804.
--Data type unknown.
--But in this is okay
SELECT * FROM TEST WHERE MYDATE + 5 >= :dateparam;
------------------------------------------------------------------------------------------
Is a bug???
Another question:
In FB 1.5 and oldest this query fails:
SELECT 1 FROM RDB$DATABASE :myparam IS NULL;
With the feature in FB 2.0 (Bug fix #1371274) this situation can be
corrected thus:
SELECT 1 FROM RDB$DATABASE CAST(:myparam AS INTEGER) IS NULL;
But I think that in this situation is not necessary for engine know a
datatype, because the parameter "myparam" is verified with null state.
Is not a bug, right? But a feature?
Thanks
Maycon Ferraça - Brazil
PS.:
(1) Sorry if this wrong place for this message.
(2) Sorry for my bad bad english... :S
|