1 Reply Latest reply on Nov 19, 2005 5:52 PM by Thomas Orr

    Named parameter does not appear in Query

    Thomas Orr Newbie

      I'm experiencing a weird error with EJB3 (JBoss-4.0.3SP1). I am still having trouble with positional query parameters for a native query. This query calls an sp to do its business. It works if I use all named parameters and use setParameter accordingly, but the positional technique just doesn't work.

      Named parameter does not appear in Query: 3 [{ call misc_insert(?1,?2,?3,?4,?5) }]
      


      As you can plainly see, "3" is in the sp call. Is this error a red herring? Or is positional access completely not working in this release? I've also tried it without the numbering. Then I get:

      Parameter 1 does not exist as a named parameter in [{ call misc_insert(?,?,?,?,? ) }]
      


      For both approaches described above I use the following code for setting the params:

      q.setParameter(1, username);
      q.setParameter(2, password);
      q.setParameter(3, fav);
      q.setParameter(4, token);
      q.setParameter(5, server);
      


      Thanks,
      T