Re: Error: Parameter #1 has not been set

From: Alejandro Daniel Toffetti (toffeda..oteria.gba.gov.ar)
Date: Wed May 09 2007 - 16:32:50 EDT

  • Next message: Frank: "how do I read group records?"

    Andrus Adamchik <andrus <at> objectstyle.org> writes:

    >
    > Hmm... I wonder if configuring a procedure to return a value (as
    > opposed to using an OUT parameter) causes the problem. Here is a
    > procedure from the Cayenne test suite that returns OUT parameter that
    > works with SQLServer 2005:
    >
    > 1. procedure definition:
    >
    > CREATE PROCEDURE [dbo].[cayenne_tst_out_proc] <at> in_param INT,
    > <at> out_param INT output AS
    > BEGIN
    > SELECT <at> out_param = <at> in_param * 2
    > END
    >
    > 2. Cayenne mapping of procedure (note that since procedure parameters
    > in JDBC are positional, the names I've been using are mapped for Java
    > convenience and exclude ' <at> '):
    >
    > <procedure name="cayenne_tst_out_proc">
    > <procedure-parameter name="in_param" type="INTEGER" direction="in"/>
    > <procedure-parameter name="out_param" type="INTEGER"
    > direction="out"/>
    > </procedure>
    >

    Hi Andrus,

        No no, I never intended to use an OUT parameter, I'm only
     trying to follow the tutorial as given in:

        http://cayenne.apache.org/doc20/stored-procedures.html

        The stored procedures I'm using are simple and only
    implement the CRUD operations, although I plan to do more
    complex ones later. The XML mappings are what the Modeler
    yields after reengineering my database.

        By the way I've stumbled upon more problems after I
    updated to Netbeans 6.0 Milestone 9 and Cayenne 2.0.2.
    I'm getting lots of "incompatible types" errors in
    sentences such as:

        List rows = context.performQuery(query);

        I don't even know whether they are related to Cayenne
    or Netbeans (most likely to Netbeans since its a preview
    release), but I'm a newbie and being stopped once and
    again at such very simple tasks is very frustrating.

    Cheers,

    Daniel



    This archive was generated by hypermail 2.0.0 : Wed May 09 2007 - 19:36:01 EDT