0

我试图在我的 jasper 报告查询中使用 WITH 子句,但它给了我错误:- java.sql.SQLSyntaxErrorException: ORA-00928: missing SELECT keyword and net.sf.jasperreports.engine.JRException: No input source提供给出口商。

相同的查询在 Oracle DB 客户端中运行良好。

如果在 Jasper 报告版本 3.7.6 中使用 WITH 子句有问题,请告诉我。

4

1 回答 1

0

如果您WITH在选择查询的开头使用子句,则需要更改 Jasper 报告配置,您需要指定查询以SELECT或开头WITH

如果您WITH在选择查询中间使用子句,您可能会忘记从 WITH 子句生成的数据集中选择记录。请参见下面的示例...

select * from (
  WITH temp as (
    select data from any_table
  )
)

相反,使用下面...

select * from (
  WITH temp as (
    select data from any_table
  )
  select * from temp
)

或者

select * from (
 select * from
 (
  WITH temp as (
    select data from any_table
  )
 )
)

继续查询!

于 2013-05-01T10:29:39.883 回答