CREATE PROCEDURE TEST1 (IN FROMTIMESTAMP TIMESTAMP,
IN TOTIMESTAMP TIMESTAMP,
OUT V INTEGER)
LANGUAGE SQL
--
BEGIN
DECLARE GLOBAL TEMPORARY TABLE SESSION.TEST AS (
SELECT A.ID, A.NM FROM ABC.TABLETOTEST A
WHERE
A.TOTESTTIMESTAMP BETWEEN FROMTIMESTAMP AND TOTIMESTAMP)
DEFINITION ONLY ON COMMIT PRESERVE ROWS;
SELECT COUNT(*) INTO V FROM SESSION.TEST;
END
---
This is one part of a 5 Temp table declaration within the SP but all need the FROMTIMESTAMP AND TOTIMESTAMP as a basis for the where clause.
For some reason timestamp doesnt seem to be an acceptable comparison for the operator.
Any ideas or work arounds, I tried to replace BETWEEN with the > and < ,also same problem.