problem to get stored procedure that does not return anything. [message #963563] |
Mon, 29 October 2012 18:50  |
Eclipse User |
|
|
|
I had a stored procedure, it return nothing. No matter what query I use, ReadQuery/ModifyQuery, It will always give me exception from underlying vdb(teiid).
if it is read query, it will complain the stored procedure does not return resultSet.
If it is ModifyQuery, it will complain the stored procedure does not reutrn UpdateCount.
The problem is in DatabaseAccessor.basicExecuteCall(), in the code below, if there is nothing returned, it should not call executeNoSelect() since this expect a UpdateCount, it should just call (PreparedStatement)statement.execute() instead.
Also, it did not give me a chance to hook up my own code to do that. Does any one know how to get around this?
thanks
Kevin
// effectively this means that someone is executing an update type query.
if (dbCall.isNothingReturned()) {
result = executeNoSelect(dbCall, statement, session);
if (!isInBatchWritingMode(session)) {
this.writeStatementsCount++;
}
if (dbCall.isLOBLocatorNeeded()) {
// add original (insert or update) call to the LOB locator
// Bug 2804663 - LOBValueWriter is no longer a singleton
getLOBWriter().addCall(dbCall);
}
|
|
|
|
|
|
Re: problem to get stored procedure that does not return anything. [message #982983 is a reply to message #976668] |
Tue, 13 November 2012 10:30  |
Eclipse User |
|
|
|
I have not heard of Teiid, its JDBC driver may not work with stored procedures correctly. If you use SQL Server directly using a JDBC compliant driver it should work.
You may need to get a patch from your JDBC driver, or use another driver.
If the execute the native query using getResultList() it will not use executeUpdate().
[Updated on: Tue, 13 November 2012 10:31] by Moderator
|
|
|
Powered by
FUDForum. Page generated in 0.27697 seconds