cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Raffenberg" <michael.raffenb...@t-online.de>
Subject Esql and Oracle Functions
Date Fri, 10 Oct 2003 17:31:44 GMT
Hi here is a working example with esql and Oracle Stored Proc.:
<esql:execute-query>
	<esql:call>{call pip2a9.HiQuery ('', '', '',
'583911','<xsp:expr>class_id</xsp:expr>','true','<xsp:expr>sl</xsp:expr>',
	
'','<xsp:expr>pl</xsp:expr>','<xsp:expr>ps</xsp:expr>',<esql:parameter
direction="out" type="String"/>)}
			</esql:call>
			<esql:call-results>
			<response>
			<esql:execute-query>
				<esql:query>
				  <esql:get-string ancestor="1"
from-call="true" column="1"/>
				</esql:query>		
				<esql:skip-rows><xsl:value-of
select="$skiprows"/></esql:skip-rows>
			  <esql:max-rows><xsl:value-of
select="$maxrows"/></esql:max-rows>
				<esql:results>
				<status><s.success/></status>
					<part.info>
				    <esql:row-results>
						  <element>
					      <esql:get-columns/>
							</element>
					  </esql:row-results>
					</part.info>
				</esql:results>
				<esql:no-results>
					<status><s.nomatch/></status>
				</esql:no-results>
			</esql:execute-query>
			</response>
			</esql:call-results>
			<esql:error-results>
        <message><esql:get-message/></message>
        <stacktrace><esql:get-stacktrace/></stacktrace>
      </esql:error-results>
    </esql:execute-query>

Maybe it could help you.

> -----Urspr√ľngliche Nachricht-----
> Von: colin.wilson@metoffice.com [mailto:colin.wilson@metoffice.com] 
> Gesendet: Donnerstag, 9. Oktober 2003 15:40
> An: users@cocoon.apache.org
> Betreff: Esql and Oracle Functions
> 
> 
> Is there anyway that I can get results from an Oracle 
> Function (as opposed to an Oracle Procedure). I have tried :
> 
> 	<esql:connection>
> 	  <esql:pool>oracle</esql:pool>
> 	  <esql:execute-query>
> 	  <esql:call>begin mypackage.myfunction(
>             'text',
>             'text2',
>             <esql:parameter direction="out" type="String" />,
>             <esql:parameter direction="out" type="String" />,
>             <esql:parameter direction="out" type="String" />,
>             <esql:parameter direction="out" type="Int" />,
>             <esql:parameter direction="out" type="Int" />,
>             <esql:parameter direction="out" type="String" />
>           );
>           end;
>         </esql:call>
>         <esql:call-results>
>             <esql:get-int column="1" />
>         </esql:call-results>
>     </esql:execute-query>
> </esql:connection>
> 		
> 
> But I get :
> 
> executing statement:            begin mypackage.myfunction(
> 'text',             'text2',             ?,             ?,
> ?,             ?,             ?,             ?           );
> end;     : java.sql.SQLException: ORA-06550: line 1, column 18:
> PLS-00221: 'MYFUNCTION' is not a procedure or is undefined
> ORA-06550: line 1, column 18:
> PL/SQL: Statement ignored
> 
> 
> Which is quite true of course.
> 
> 
> The Oracle function is defined as:
> 
> FUNCTION myfunction
>   (
>   p_a    VARCHAR2,
>   p_b      VARCHAR2,
>   p_c     OUT NUMBER,
>   p_d    OUT VARCHAR2,
>   p_e     OUT VARCHAR2,
>   p_f     OUT NUMBER,
>   p_g    OUT NUMBER,
>   p_h      OUT VARCHAR2
>   ) RETURN NUMBER
> 
> And has been used many times before from java etc.
> 
> 
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 


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


Mime
View raw message