SQL query - Date parameter problem [message #97397] |
Thu, 08 December 2005 15:28 |
Eclipse User |
|
|
|
Originally posted by: josemcca.ie.ibm.com
Hi, I'm running a report using this SQL query:
SELECT
SUM( DATE('2005-01-01') - DATE(rce.start_date + 0 SECONDS) )
FROM
repeating_calendar_element rce,
room crm
WHERE
DATE(rce.start_date + 0 SECONDS) <=3D '2005-01-01'
AND DATE(rce.end_date + 0 SECONDS) >=3D '2005-01-01'
AND rce.schedulable_ref_oid =3D crm.oid
but whenever I change the date in the DATE() function to a parameter, i.=
e. =
SUM( DATE(?) - DATE(rce.start_date + 0 SECONDS) ), I get the following =
message:
A Birt exception occurred.
Plug-in Provider:Eclipse.org
Plug-in Name:BIRT Data Engine
Plug-in ID:org.eclipse.birt.data
Version:1.0.1
Error Code:odaconsumer.CannotGetResultSetMetaData
Error Message:Cannot get the result set metadata.
SQL statement does not return a ResultSet object
DB2 SQL error: SQLCODE: -418, SQLSTATE: 42610, SQLERRMC: null
Any ideas what I can do to fix this?
Thanks
Joe
|
|
|
Re: SQL query - Date parameter problem [message #97562 is a reply to message #97397] |
Thu, 08 December 2005 18:06 |
Eclipse User |
|
|
|
Originally posted by: jake.westviewclose.co.uk
Joe,
I'm not sure that i can help, but a couple of things to check (i'm sure
you've already done this?)
Is the date parameter a date or a string - for this it would need to be
a string passed in?
Or have you tried physically inserting the quote marks to the query
around the ? itself?
Not sure this will help, but thought i'd try
Cheers
jake
josemcca@ie.ibm.com wrote:
> Hi, I'm running a report using this SQL query:
>
> SELECT
> SUM( DATE('2005-01-01') - DATE(rce.start_date + 0 SECONDS) )
> FROM
> repeating_calendar_element rce,
> room crm
> WHERE
> DATE(rce.start_date + 0 SECONDS) <= '2005-01-01'
> AND DATE(rce.end_date + 0 SECONDS) >= '2005-01-01'
> AND rce.schedulable_ref_oid = crm.oid
>
> but whenever I change the date in the DATE() function to a parameter,
> i.e. SUM( DATE(?) - DATE(rce.start_date + 0 SECONDS) ), I get the
> following message:
> A Birt exception occurred.
> Plug-in Provider:Eclipse.org
> Plug-in Name:BIRT Data Engine
> Plug-in ID:org.eclipse.birt.data
> Version:1.0.1
> Error Code:odaconsumer.CannotGetResultSetMetaData
> Error Message:Cannot get the result set metadata.
> SQL statement does not return a ResultSet object
> DB2 SQL error: SQLCODE: -418, SQLSTATE: 42610, SQLERRMC: null
>
> Any ideas what I can do to fix this?
>
> Thanks
>
> Joe
|
|
|
Powered by
FUDForum. Page generated in 0.03026 seconds