0

有没有人成功地将 Play 框架与 IBM DB2 for AS00 或 DB2LUW 一起使用。我试图在 AS400 上针对 DB2 db 运行 Zentasks 示例,但我得到了这个异常:

Internal server error, for (GET) [/projects/1/tasks]

play.api.Application$$anon$1: Execution exception[[PersistenceException: Query threw SQLException:Token <END-OF-STATEMENT> not valid. Valid tokens: AS CL IN LOG OUT DATA COLLECT.                                                                                
Bind values:[null]                                                                                                               
Query was:                                                                                                                       
select count(*) from ( select distinct t0.id c0                                                                                  
from project t0                                                                                                                  
join project_account u1z_ on u1z_.project_id = t0.id                                                                             
join account u1 on u1.email = u1z_.account_email                                                                                 
where u1.email = ?  and t0.id = ? )

上述查询在 DB2 语法中无效。一个有效的应该是这样的;

with qry as ( select distinct t0.id c0                                                                                  
from project t0                                                                                                                  
join project_account u1z_ on u1z_.project_id = t0.id                                                                             
join account u1 on u1.email = u1z_.account_email)  
select count(*) from qry where u1.email = ?  and t0.id = ?      

4

0 回答 0