Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 316260

Summary: [Regression] Output parameter returns null and Exception thrown out
Product: z_Archived Reporter: mindan xu <mindan.xu>
Component: BIRTAssignee: Mingxia Wu <mwu>
Status: CLOSED INVALID QA Contact: mindan xu <mindan.xu>
Severity: normal    
Priority: P3 CC: mwu
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard: Non-Auto

Description mindan xu CLA 2010-06-09 05:28:33 EDT
Description:
Execute following stored procedure:

set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go

ALTER PROCEDURE [dbo].[OrdersByProductProc](@Product varchar(50), @test int
output)
as
SELECT count(*), productName FROM orderdetails, products 
WHERE orderdetails.productCode = products.productCode 
AND products.productName = @Product GROUP BY products.productName;

Select @test=count(*) FROM orderdetails;


Build number: 2.6.0.v20100609-0630

Expected result is 
1, @test = 2996 ( which equals to count(*)); 
2, @Reture Value = 0 
3, Result set is retrieved successfully.

Actual result:
1, When executing in Stored Procedure data set, @test = null 
2, When previewing Output Parameters, I got exceptions.

ErrorLog:
org.eclipse.birt.data.engine.odaconsumer.OdaDataException: Cannot execute the statement.
org.eclipse.birt.report.data.oda.jdbc.JDBCException: SQL statement does not return a ResultSet object.
SQL error #1: Procedure or Function 'OrdersByProductProc' expects parameter '@Product', which was not supplied.
;
java.sql.SQLException: Procedure or Function 'OrdersByProductProc' expects parameter '@Product', which was not supplied.
at org.eclipse.birt.data.engine.odaconsumer.ExceptionHandler.newException(ExceptionHandler.java:52)
at org.eclipse.birt.data.engine.odaconsumer.ExceptionHandler.throwException(ExceptionHandler.java:108)
at org.eclipse.birt.data.engine.odaconsumer.ExceptionHandler.throwException(ExceptionHandler.java:84)
at org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.execute(PreparedStatement.java:586)
at org.eclipse.birt.data.engine.executor.DataSourceQuery.execute(DataSourceQuery.java:765)
at org.eclipse.birt.data.engine.impl.PreparedOdaDSQuery$OdaDSQueryExecutor.executeOdiQuery(PreparedOdaDSQuery.java:427)
at org.eclipse.birt.data.engine.impl.QueryExecutor.execute(QueryExecutor.java:1045)
at org.eclipse.birt.data.engine.impl.ServiceForQueryResults.executeQuery(ServiceForQueryResults.java:232)
at org.eclipse.birt.data.engine.impl.QueryResults.getResultIterator(QueryResults.java:159)
at org.eclipse.birt.report.designer.data.ui.dataset.ResultSetPreviewPage.populateRecords(ResultSetPreviewPage.java:568)
at org.eclipse.birt.report.designer.data.ui.dataset.ResultSetPreviewPage.access$5(ResultSetPreviewPage.java:562)
at org.eclipse.birt.report.designer.data.ui.dataset.ResultSetPreviewPage$5.run(ResultSetPreviewPage.java:483)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Caused by: org.eclipse.birt.report.data.oda.jdbc.JDBCException: SQL statement does not return a ResultSet object.
SQL error #1: Procedure or Function 'OrdersByProductProc' expects parameter '@Product', which was not supplied.
;
java.sql.SQLException: Procedure or Function 'OrdersByProductProc' expects parameter '@Product', which was not supplied.
at org.eclipse.birt.report.data.oda.jdbc.CallStatement.executeQuery(CallStatement.java:438)
at org.eclipse.birt.report.data.oda.jdbc.CallStatement.execute(CallStatement.java:587)
at org.eclipse.datatools.connectivity.oda.consumer.helper.OdaAdvancedQuery.doExecute(OdaAdvancedQuery.java:123)
at org.eclipse.datatools.connectivity.oda.consumer.helper.OdaAdvancedQuery.execute(OdaAdvancedQuery.java:82)
at org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.execute(PreparedStatement.java:570)
... 9 more
Caused by: java.sql.SQLException: Procedure or Function 'OrdersByProductProc' expects parameter '@Product', which was not supplied.
at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:367)
at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2217)
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:1696)
at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:522)
at net.sourceforge.jtds.jdbc.JtdsStatement.processResults(JtdsStatement.java:386)
at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQL(JtdsStatement.java:369)
at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.execute(JtdsPreparedStatement.java:426)
at org.eclipse.birt.report.data.oda.jdbc.CallStatement.executeQuery(CallStatement.java:402)
... 13 more
Comment 1 Mingxia Wu CLA 2010-06-13 04:41:17 EDT
It works in my environment. I guess you do not input the required default value for the data set parameter @Product. Please check it again.
Comment 2 mindan xu CLA 2010-06-23 04:33:39 EDT
Close the bug