Re: ProcedureQuery problem

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Mon Mar 27 2006 - 11:21:53 EST

  • Next message: Cris Daniluk: "Re: DataContext scope in web apps"

    Hi Marie,

    I noticed a mismatch between your procedure definition and Cayenne
    mapping:

    <procedure name="GETEXAVALBR" returningValue="true">

    "returningValue" should only be "true" for Oracle *functions*, not
    procedures. Try unchecking the corresponding checkbox in the Modeler.

    Andrus

    On Mar 27, 2006, at 8:16 PM, Marie Goutière wrote:

    > Hello
    > I've a problem pl/sql with a ProcedureQuery.
    > here's my java code :
    > ProcedureQuery query = new ProcedureQuery("GETEXAVALBR");
    > query.addParameter("idDevice", deviceId);
    > query.addParameter("codeMcoEnt", codeMco);
    > query.addParameter("dateQuestionBR", dateReview);
    > query.addParameter("codeForecast", forecastNum);
    >
    > try{
    > List result =dgctContext.performQuery(query);
    > }
    > catch (Exception e){
    > // PB dans la requete return null
    > DgctLogger.error("DB Request GETEXIST2VALBR Failed");
    > DgctLogger.error(e.toString());
    > }
    >
    > My proc stoc returns only one field of an oracle table
    >
    > in my map.xml you can find :
    > <procedure name="GETEXAVALBR" returningValue="true">
    > <procedure-parameter name="valBr" type="VARCHAR" length="10"
    > direction="out"/>
    > <procedure-parameter name="idDevice" type="VARCHAR" length="10"
    > direction="in"/>
    > <procedure-parameter name="codeMcoEnt" type="VARCHAR" length="2"
    > direction="in"/>
    > <procedure-parameter name="dateQuestionBR" type="VARCHAR"
    > length="10" direction="in"/>
    > <procedure-parameter name="codeForecast" type="VARCHAR" length="10"
    > direction="in"/>
    > </procedure>
    >
    > and the declation of the procedure is :
    >
    > CREATE OR REPLACE PROCEDURE GETEXAVALBR(
    > valBr OUT varchar,
    > idDevice IN varchar,
    > codeMcoEnt IN varchar,
    > dateQuestionBR IN varchar,
    > codeForecast IN varchar
    > ) IS
    >
    > here is the trace in tomcat :
    > QueryLogger: {? = call GETEXAVALBR(?, ?, ?, ?)} [bind: '[OUT]',
    > 'NA485', '2', '01/02/2004', '18']
    > I don't know if the binding is correct but I always have the same
    > error although i'tried a lot of things.
    > here is the PL/SQL error
    > PLS-00306: wrong number or types of arguments in call to 'GETEXAVALBR'
    >
    > I've no Idea left
    > Can anyone rescue me???? :))
    > Thanks
    >
    >
    >



    This archive was generated by hypermail 2.0.0 : Mon Mar 27 2006 - 11:22:19 EST