【发布时间】:2015-01-20 07:24:25
【问题描述】:
我们的客户多年来一直在 windows XP 机器上使用多个水晶报表,我负责支持这些报表。它工作得很好。最近我们升级到 Windows 7 机器,其中一个水晶报表停止运行,而其他水晶报表在 Windows 7 机器上正常工作。我无法确定一份报告停止运行的原因。水晶报表是通过java应用程序调用的。下面是我得到的错误信息,
ODBC error:[IBM][System i Access ODBC Driver][DB2 for i5/OS]SQL0104 - Token = was not vaild. Valid tokens: ( + - ? : DAY INF NAN RID ROW RRN CASE CAST CHAR DATE DAYS HASH.
上面是错误信息。报表的SQL如下,
SELECT
customermastertable."customerFirstname", customermastertable."customer1Firstname",
celebrationmastertable."celebrationnumber", celebrationmastertable."storenumber", celebrationmastertable."customerssurname", celebrationmastertable."customerssurname2", celebrationmastertable."activestatus",
prodstoretable."storename"
FROM
("proddatatable"."customermastertable" customermastertable INNER JOIN "proddatatable"."celebrationmastertable" celebrationmastertable ON
customermastertable."customernumber" = celebrationmastertable."customernumber1")
INNER JOIN "proddatatable"."prodstoretable" prodstoretable ON
celebrationmastertable."storenumber" = prodstoretable."storenumber"
WHERE
customermastertable."customernumber" = celebrationmastertable."customernumber1" AND
celebrationmastertable."storenumber1" = prodstoretable."storenumber" AND
celebrationmastertable."celebrationnumber" = '?'.
最后一个celebrationnumber是运行时传入的参数。
通过比较上述错误消息和 sql 查询,您能否告知可能导致此报告仅在 Windows 7 中停止工作的原因。同样的报告在 windows xp 机器上运行良好。
【问题讨论】:
-
最后的
= '?'在我看来不合适。如果它是一个参数标记,它不应该被这样的单引号包围。庆祝数字列的数据类型是什么?
标签: sql windows-7 crystal-reports db2 odbc