Re: OUT Parameter(Stored Procedure).

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Mon Jun 14 2004 - 15:09:29 EDT

  • Next message: Andrus Adamchik: "[ANN] Cayenne 1.1 M7 Released"

    Hi Gana,

    The order of parameters depends on how they are declared in the
    database stored procedure, no matter whether they are IN, OUT or INOUT.

    Now, like you said, OUT parameters and result sets are different
    things. So the API is a bit different from the normal SelectQuery.
    Follow the example given in User Guide chapter 9.2
    (http://objectstyle.org/cayenne/userguide/stored-procedures/any.html),
    using QueryResult object to collect all the results. It is not clear
    from the docs on the site (I guess I may need to update those), but OUT
    parameters are stored as if it was the very first ResultSet in a query
    that can have multiple result sets:

    QueryResult results = new QueryResult();
    ctxt.performQuery(query, results);

    // extract the results...
    // assume that you only have OUT parameters, but no "normal" results set
    List firstResultSet = results.getFirstRows(query);
    Map outParamValues = (Map) firstResultSet.get(0);

    Andrus

    On Jun 14, 2004, at 2:36 PM, Friend Friend wrote:

    > Is there any specific order I have to follow to declare the OUT
    > parameter in the Parameter list in the stored procedure?
    >  
    > How do I access the OUT parameter. I am trying to get the stored
    > procedure Status as the out parameter. ( This information is not
    > included in the result set).
    >  
    > Thanks
    > -Gana



    This archive was generated by hypermail 2.0.0 : Mon Jun 14 2004 - 15:09:38 EDT