Subject | Execute Statement and Date type |
---|---|
Author | kokok_kokok |
Post date | 2004-06-18T10:52:39Z |
In a stored procedure I need to use the Execute Statement feature of
FB 1.5. I do not know how I can join the date parameters (date type)
with the text (varchar type) of the DSQL instruction into a Stored
Procedure.
I tried: 'where orderdate between '|| mindate ||'....
Also: 'where orderdate between '|| cast(mindate as varchar(16))||'....
But I get errors of conversion.
The PSQL code is:
-------
CREATE PROCEDURE "OPENREASONS"
(
"MINDATE" DATE,
"MAXDATE" DATE,
"ADDITIONALFILTER" VARCHAR(300)
)
...
declare variable sql varchar(1024);
....
sql='select orderdate, count(*) from orders where orderdate between '
|| mindate ||' and '||maxdate ||' and '||additionalfilter;
for execute statement sql into :f1,:f2
....
-------
Thanks in advance
FB 1.5. I do not know how I can join the date parameters (date type)
with the text (varchar type) of the DSQL instruction into a Stored
Procedure.
I tried: 'where orderdate between '|| mindate ||'....
Also: 'where orderdate between '|| cast(mindate as varchar(16))||'....
But I get errors of conversion.
The PSQL code is:
-------
CREATE PROCEDURE "OPENREASONS"
(
"MINDATE" DATE,
"MAXDATE" DATE,
"ADDITIONALFILTER" VARCHAR(300)
)
...
declare variable sql varchar(1024);
....
sql='select orderdate, count(*) from orders where orderdate between '
|| mindate ||' and '||maxdate ||' and '||additionalfilter;
for execute statement sql into :f1,:f2
....
-------
Thanks in advance