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.
--
C h r i s t i a n H a u l
[EMAIL PROTECTED]
fingerprint: 99B0 1D9D 7919 644A 4837 7D73 FEF9 6856 335A 9E08
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]