Query inputs using 'Set Macros'
I have a query which requires more than one input parameters. As an example
Select count(*) from TestTable where date > '2012/10/05' and date < '2012/10/10'
I would like to pass the date parameter as variable . So my query will look like
Select count(*) from TestTable where date > ? and date < ?
How do I pass 2 variables to the 'Read Database Operator' ? I tried usibg 'Set Macros' and defined 'dt1' and 'dt2' and used them in 'Read Database' with 'prepare statement' and adding VARCHAR {%dt1} and {%dt2} to the Edit Enumeration.
I get the error
ERROR: invalid input syntax for type date: "dt1"
Is there different way to pass more than one variables to sql statement ? It works fine if I have one variable . E.g
Select Count(*) from TestTable where date = ?
And define input variable with 'Set Macro'.
Select count(*) from TestTable where date > '2012/10/05' and date < '2012/10/10'
I would like to pass the date parameter as variable . So my query will look like
Select count(*) from TestTable where date > ? and date < ?
How do I pass 2 variables to the 'Read Database Operator' ? I tried usibg 'Set Macros' and defined 'dt1' and 'dt2' and used them in 'Read Database' with 'prepare statement' and adding VARCHAR {%dt1} and {%dt2} to the Edit Enumeration.
I get the error
ERROR: invalid input syntax for type date: "dt1"
Is there different way to pass more than one variables to sql statement ? It works fine if I have one variable . E.g
Select Count(*) from TestTable where date = ?
And define input variable with 'Set Macro'.
0
Answers
Thanks.
Marcin
<宏/ >
<运营商激活d="true" class="process" compatibility="5.2.008" expanded="true" name="Process">
<运营商激活d="true" class="read_database" compatibility="5.2.008" expanded="true" height="60" name="Read Database" width="90" x="179" y="30">
<运营商激活d="true" class="set_macros" compatibility="5.2.008" expanded="true" height="76" name="Set Macros" width="90" x="45" y="120">