cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Rusnak <martin.rus...@voipac.com>
Subject Re: Problem getting result set from Oracle stored procedures
Date Fri, 05 Sep 2003 12:11:25 GMT
Here is full source of the page:

<?xml version="1.0"?>
<xsp:page language="java"
	xmlns:xsp="http://apache.org/xsp"
	xmlns:esql="http://apache.org/cocoon/SQL/v2">
<rowset>
<esql:connection>
   <esql:pool>oracle-connection</esql:pool>
   <esql:execute-query>
     <esql:call resultset-from-object="1">{?=call sp_test()}</esql:call>
     <esql:call-results>
       <esql:row-results>
         <row>
           <esql:get-columns/>
         </row>
       </esql:row-results>
     </esql:call-results>
   </esql:execute-query>
</esql:connection>
</rowset>
</xsp:page>


Christian Haul wrote:
> On 05.Sep.2003 -- 09:02 AM, Martin Rusnak wrote:
> 
>>Hello all,
>>
>>I am trying to get result set from a stored procedure (function)
>>in Oracle database, using Cocoon 2.1 ESQL. My working Java code
>>looks like the following:
>>
>>
>>CallableStatement cstmt = conn.prepareCall("{?=call sp_resultset()}");
>>cstmt.registerOutParameter(1,OracleTypes.CURSOR);
>>cstmt.execute();
>>ResultSet rs = (ResultSet)cstmt.getObject(1);
>>
>>
>>I tried to use esql:call element with the @resultset-from-object
>>attribute, but the page processing failed with LanguageException.
>>Here is the XSP code snippet I used:
>>
>>
>><esql:execute-query>
>>	<esql:call resultset-from-object="1">{?=call 
>>	sp_resultset()}</esql:call>
>>	<esql:call-results>
> 
> 
> Use call results *only* if you are accessing regular out
> parameters. You have asked to convert the first out parameter to a
> ResultSet for you and use that. Hence you need to proceed with
> 
>    <esql:results><!-- was <esql:call-results> -->
> 
>>		<esql:row-results>
>>			<row>
>>			<esql:get-columns/>
>>			</row>
>>		</esql:row-results>
>>	</esql:call-results>
>></esql:execute-query>
>>
>>
>>
>>The exeption message is:
>>
>>
>>org.apache.cocoon.components.language.LanguageException: Error compiling 
>>servers_ora_xsp:
>>ERROR 1 (org/apache/cocoon/www/noc/docs/servers_ora_xsp.java):
>>...
>>"resultset-from-object",
>>"resultset-from-object",
>>"CDATA",
>>"1"
>>
>>// start error (lines 518-518) "Syntax error on token ";", ")" expected"
>>);
>>
>>// end error
>>
>>
>>this.contentHandler.startElement(
>>"http://apache.org/cocoon/SQL/v2",
>>
>>...
>>Line 518, column 0: Syntax error on token ";", ")" expected
> 
> 
> The above error message indicates, however, that you have omitted a
> necessary tag or used a wrong ordering. Could you post the complete
> XSP, pls?
> 
> 
> 
>>The question is if there is a bug in ESQL transformation and possibly
>>in my ESQL code...
> 
> 
> Your ESQL code ;-)
> 
> 	Chris.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message