【发布时间】:2011-11-05 16:18:12
【问题描述】:
谁能帮我将参数传递给 birt 数据集中的存储过程?当我尝试运行报告时,我总是得到这个异常:
org.eclipse.birt.report.data.oda.jdbc.JDBCException:无法设置preparedStatement 参数字符串值。 SQL 错误 #1:列索引超出范围:1,列数:0。 ; org.postgresql.util.PSQLException:列索引超出范围:1,列数:0。 在 org.eclipse.birt.report.data.oda.jdbc.Statement.setString(Statement.java:656) 在 org.eclipse.datatools.connectivity.oda.consumer.helper.OdaQuery.setString(OdaQuery.java:733) 在 org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.doSetString(PreparedStatement.java:4422) 在 org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.setString(PreparedStatement.java:4031) 在 org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.setParameterValue(PreparedStatement.java:3235) 在 org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.setParameterValue(PreparedStatement.java:3171) 在 org.eclipse.birt.data.engine.executor.DataSourceQuery.setInputParameterBinding(DataSourceQuery.java:947) 在 org.eclipse.birt.data.engine.executor.DataSourceQuery.addParameterDefns(DataSourceQuery.java:530) 在 org.eclipse.birt.data.engine.executor.DataSourceQuery.prepare(DataSourceQuery.java:283) 在 org.eclipse.birt.data.engine.impl.PreparedOdaDSQuery$OdaDSQueryExecutor.prepareOdiQuery(PreparedOdaDSQuery.java:413) 在 org.eclipse.birt.data.engine.impl.QueryExecutor.prepareExecution(QueryExecutor.java:339) 在 org.eclipse.birt.data.engine.impl.PreparedQuery.doPrepare(PreparedQuery.java:448) 在 org.eclipse.birt.data.engine.impl.PreparedDataSourceQuery.produceQueryResults(PreparedDataSourceQuery.java:190) 在 org.eclipse.birt.data.engine.impl.PreparedDataSourceQuery.execute(PreparedDataSourceQuery.java:178) 在 org.eclipse.birt.data.engine.impl.PreparedOdaDSQuery.execute(PreparedOdaDSQuery.java:145) 在 org.eclipse.birt.report.data.adapter.impl.DataRequestSessionImpl.execute(DataRequestSessionImpl.java:560) 在 org.eclipse.birt.report.engine.data.dte.DteDataEngine.doExecuteQuery(DteDataEngine.java:152) 在 org.eclipse.birt.report.engine.data.dte.AbstractDataEngine.execute(AbstractDataEngine.java:265) 在 org.eclipse.birt.report.engine.executor.ExecutionContext.executeQuery(ExecutionContext.java:1875) 在 org.eclipse.birt.report.engine.executor.QueryItemExecutor.executeQuery(QueryItemExecutor.java:80) 在 org.eclipse.birt.report.engine.executor.TableItemExecutor.execute(TableItemExecutor.java:62) 在 org.eclipse.birt.report.engine.internal.executor.dup.SuppressDuplicateItemExecutor.execute(SuppressDuplicateItemExecutor.java:43) 在 org.eclipse.birt.report.engine.internal.executor.wrap.WrappedReportItemExecutor.execute(WrappedReportItemExecutor.java:46) 在 org.eclipse.birt.report.engine.internal.executor.l18n.LocalizedReportItemExecutor.execute(LocalizedReportItemExecutor.java:34) 在 org.eclipse.birt.report.engine.layout.html.HTMLBlockStackingLM.layoutNodes(HTMLBlockStackingLM.java:65) 在 org.eclipse.birt.report.engine.layout.html.HTMLPageLM.layout(HTMLPageLM.java:90) 在 org.eclipse.birt.report.engine.layout.html.HTMLReportLayoutEngine.layout(HTMLReportLayoutEngine.java:99) 在 org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doRun(RunAndRenderTask.java:170) 在 org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run(RunAndRenderTask.java:75) 在 cz.dantem.fast.vm.birt.reports.ExecuteReport$1.run(ExecuteReport.java:185) 在 org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121) 引起:org.postgresql.util.PSQLException:索引 sloupece je mimo rozsah:1,počet sloupců:0。 在 org.postgresql.core.v3.SimpleParameterList.bind(SimpleParameterList.java:53) 在 org.postgresql.core.v3.SimpleParameterList.setStringParameter(SimpleParameterList.java:118) 在 org.postgresql.jdbc2.AbstractJdbc2Statement.bindString(AbstractJdbc2Statement.java:2184) 在 org.postgresql.jdbc2.AbstractJdbc2Statement.setString(AbstractJdbc2Statement.java:1303) 在 org.postgresql.jdbc2.AbstractJdbc2Statement.setString(AbstractJdbc2Statement.java:1289) 在 org.eclipse.birt.report.data.oda.jdbc.Statement.setString(Statement.java:651) ... 30 更多 5.11.2011 17:03:47 org.eclipse.birt.data.engine.odaconsumer.PreparedStatement retrySetParameterValue 严重:无法设置输入参数。 org.eclipse.birt.data.engine.core.DataException:无法将字符串值 (LP) 设置为参数 1。 无法设置preparedStatement 参数字符串值。 SQL 错误 #1:列索引超出范围:1,列数:0。 在 org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.handleException(PreparedStatement.java:4835) 在 org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.doSetString(PreparedStatement.java:4427) 在 org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.setString(PreparedStatement.java:4031) 在 org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.setParameterValue(PreparedStatement.java:3235) 在 org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.setParameterValue(PreparedStatement.java:3171) 在 org.eclipse.birt.data.engine.executor.DataSourceQuery.setInputParameterBinding(DataSourceQuery.java:947) 在 org.eclipse.birt.data.engine.executor.DataSourceQuery.addParameterDefns(DataSourceQuery.java:530) 在 org.eclipse.birt.data.engine.executor.DataSourceQuery.prepare(DataSourceQuery.java:283) 在 org.eclipse.birt.data.engine.impl.PreparedOdaDSQuery$OdaDSQueryExecutor.prepareOdiQuery(PreparedOdaDSQuery.java:413) 在 org.eclipse.birt.data.engine.impl.QueryExecutor.prepareExecution(QueryExecutor.java:339) 在 org.eclipse.birt.data.engine.impl.PreparedQuery.doPrepare(PreparedQuery.java:448) 在 org.eclipse.birt.data.engine.impl.PreparedDataSourceQuery.produceQueryResults(PreparedDataSourceQuery.java:190) 在 org.eclipse.birt.data.engine.impl.PreparedDataSourceQuery.execute(PreparedDataSourceQuery.java:178) 在 org.eclipse.birt.data.engine.impl.PreparedOdaDSQuery.execute(PreparedOdaDSQuery.java:145) 在 org.eclipse.birt.report.data.adapter.impl.DataRequestSessionImpl.execute(DataRequestSessionImpl.java:560) 在 org.eclipse.birt.report.engine.data.dte.DteDataEngine.doExecuteQuery(DteDataEngine.java:152) 在 org.eclipse.birt.report.engine.data.dte.AbstractDataEngine.execute(AbstractDataEngine.java:265) 在 org.eclipse.birt.report.engine.executor.ExecutionContext.executeQuery(ExecutionContext.java:1875) 在 org.eclipse.birt.report.engine.executor.QueryItemExecutor.executeQuery(QueryItemExecutor.java:80) 在 org.eclipse.birt.report.engine.executor.TableItemExecutor.execute(TableItemExecutor.java:62) 在 org.eclipse.birt.report.engine.internal.executor.dup.SuppressDuplicateItemExecutor.execute(SuppressDuplicateItemExecutor.java:43) 在 org.eclipse.birt.report.engine.internal.executor.wrap.WrappedReportItemExecutor.execute(WrappedReportItemExecutor.java:46) 在 org.eclipse.birt.report.engine.internal.executor.l18n.LocalizedReportItemExecutor.execute(LocalizedReportItemExecutor.java:34) 在 org.eclipse.birt.report.engine.layout.html.HTMLBlockStackingLM.layoutNodes(HTMLBlockStackingLM.java:65) 在 org.eclipse.birt.report.engine.layout.html.HTMLPageLM.layout(HTMLPageLM.java:90) 在 org.eclipse.birt.report.engine.layout.html.HTMLReportLayoutEngine.layout(HTMLReportLayoutEngine.java:99) 在 org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doRun(RunAndRenderTask.java:170) 在 org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run(RunAndRenderTask.java:75) 在 cz.dantem.fast.vm.birt.reports.ExecuteReport$1.run(ExecuteReport.java:185) 在 org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121) 原因:org.eclipse.birt.report.data.oda.jdbc.JDBCException:无法设置preparedStatement参数字符串值。 SQL 错误 #1:索引 sloupece je mimo rozsah: 1, počet sloupců: 0。 ; org.postgresql.util.PSQLException:索引 sloupece je mimo rozsah:1,počet sloupců:0。 在 org.eclipse.birt.report.data.oda.jdbc.Statement.setString(Statement.java:656) 在 org.eclipse.datatools.connectivity.oda.consumer.helper.OdaQuery.setString(OdaQuery.java:733) 在 org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.doSetString(PreparedStatement.java:4422) ... 28 更多 引起:org.postgresql.util.PSQLException:索引 sloupece je mimo rozsah:1,počet sloupců:0。 在 org.postgresql.core.v3.SimpleParameterList.bind(SimpleParameterList.java:53) 在 org.postgresql.core.v3.SimpleParameterList.setStringParameter(SimpleParameterList.java:118) 在 org.postgresql.jdbc2.AbstractJdbc2Statement.bindString(AbstractJdbc2Statement.java:2184) 在 org.postgresql.jdbc2.AbstractJdbc2Statement.setString(AbstractJdbc2Statement.java:1303) 在 org.postgresql.jdbc2.AbstractJdbc2Statement.setString(AbstractJdbc2Statement.java:1289) 在 org.eclipse.birt.report.data.oda.jdbc.Statement.setString(Statement.java:651) ... 30 更多 5.11.2011 17:03:47 org.eclipse.birt.report.engine.emitter.excel.ExcelEmitter 需要OutputInMasterPage【问题讨论】:
-
我用 select * from procedureName('?') 调用我的函数。过程返回数据表,有一个输入参数——文本
-
你的存储过程的参数类型是什么?
标签: postgresql stored-procedures birt