5 Replies Latest reply: May 3, 2013 5:51 PM by rp0428 RSS

    Hashset Object Setting in Stored procedure

    1006812

      I have a store Procedure:
      CREATE PROCEDURE TESTING_SET(TEST_SET SET(CHAR(100) NOT NULL))
      RETURNING CHAR(100);
      DEFINE element CHAR(100);
      FOREACH SELECT * INTO element FROM TABLE(TEST_SET)
      RETURN element WITH RESUME;
      END FOREACH;
      END PROCEDURE;

      I am trying to call a stored procedure using CallableStetement. The stored procedure accepts a SET object. So I am setting the Hasset as CallableStatement.setObject(HashSet);

      But when the CallableStatement.execte() is called I am getting the following error:

      java.sql.SQLException: Routine (testing_set) can not be resolved.
      at com.informix.jdbc.IfxSqli.a(IfxSqli.java:3631)
      at com.informix.jdbc.IfxSqli.E(IfxSqli.java:3963)
      at com.informix.jdbc.IfxSqli.dispatchMsg(IfxSqli.java:2693)
      at com.informix.jdbc.IfxSqli.receiveMessage(IfxSqli.java:2609)
      at com.informix.jdbc.IfxSqli.a(IfxSqli.java:1828)
      at com.informix.jdbc.IfxSqli.executeExecute(IfxSqli.java:2521)
      at com.informix.jdbc.IfxSqli.executeExecute(IfxSqli.java:2461)
      at com.informix.jdbc.IfxResultSet.b(IfxResultSet.java:393)
      at com.informix.jdbc.IfxStatement.a(IfxStatement.java:1326)
      at com.informix.jdbc.IfxPreparedStatement.d(IfxPreparedStatement.java:449)
      at com.informix.jdbc.IfxCallableStatement.execute(IfxCallableStatement.java:331)
      at com.west.wic.test.HashSetTest.main(HashSetTest.java:40)
      Caused by: java.sql.SQLException
      at com.informix.util.IfxErrMsg.getSQLException(IfxErrMsg.java:413)
      at com.informix.jdbc.IfxSqli.E(IfxSqli.java:3968)
      ... 10 more
      error message:Routine (testing_set) can not be resolved.
      error code:-674

      Please help me in this regard.

        • 1. Re: Hashset Object Setting in Stored procedure
          rp0428
          You will need to post on an Informix forum or search their web site for documentation on using JDBC with their database.
          • 2. Re: Hashset Object Setting in Stored procedure
            gimbal2
            rp0428 wrote:
            You will need to post on an Informix forum or search their web site for documentation on using JDBC with their database.
            But first make sure that the database user you're using has the rights to access said procedure, and make sure you're actually connecting to the correct database of course.
            • 3. Re: Hashset Object Setting in Stored procedure
              rp0428
              I'm not using a database - OP is. So OP is the one that needs to check things. There should be a 'reply' link next to OP's postings you can use to reply to OP.
              • 4. Re: Hashset Object Setting in Stored procedure
                gimbal2
                rp0428 wrote:
                I'm not using a database - OP is. So OP is the one that needs to check things. There should be a 'reply' link next to OP's postings you can use to reply to OP.
                I wasn't directly replying to you, I was adding to what you said. There are more ways to use a forum than the way you think is right.
                • 5. Re: Hashset Object Setting in Stored procedure
                  rp0428
                  >
                  I wasn't directly replying to you
                  >
                  Well maybe that wasn't your intention but that is what this line in the reply means:
                  >
                  Posted: May 3, 2013 12:19 PM in response to: rp0428
                  >
                  That means you are responding to 'rp0428'; that's me. So when you say this
                  >
                  But first make sure that the database user you're using
                  >
                  And because your comments are 'in response to: rp0428' the word "you're" is generally going to be interpreted to mean 'rp0428' unless you indicate otherwise.

                  If you had responded to OP that word "you're" would mean you are telling OP to
                  >
                  first make sure that the database user you're using
                  >
                  It isn't a question of 'right'; it is a question of how to address your remarks to the proper person so that that person KNOWS the remarks are meant for them.

                  Here's an easy way for you to remember who to reply to: it is the same person you would LOOK at if you were in the same room with them.

                  You would be looking at me while you were listening to my comments. Then you would turn and look at OP when you made yours. In the forum you accomplish that by using the 'reply' link on one of OP's comments.

                  If, for some reason, you did want to make comments to both of us in your one reply then pick one to reply to, even me, and then preface your comment to OP like this:
                  >
                  -- comment here for rp0428 - but you didn't make any
                  OP: first make sure that the database user you're using . . .
                  >
                  See how that 'OP:' prefix makes it clear that, even though your comments are 'in response to: rp0428' that particular comment is meant for OP?

                  It might be aarkward at first but once you try it a few times you'll get the hang of it. ;)