0

I’m new in pl/sq.

So, I’m trying to call pl/sql stored procedure from Java, but appears error:

wrong number or types of arguments in call to ‘searchuser’.

Where can I find most specific exception?

Is there some error logs or errors table in oracle? How can I debug these kind of problems?

Thanks!

1 Answer 1

1

one thing is if you call stored procedures from java: don't forget to register the function result. Example Java code:

        CallableStatement cstmt = connection.prepareCall("{? = call xxx.checkArea(?,?)}");

        // the 1st Parameter is the result of the function checkArea
        cstmt.registerOutParameter(1, Types.INTEGER);   // Function Return
        cstmt.setInt(2, status);                        // Parameter 1 (in)
        cstmt.registerOutParameter(3, Types.INTEGER);   // Parameter 2 (out)

        // execute the call
        cstmt.execute();

        // check the results
        sessionId = cstmt.getInt(1); // Session-ID
        rows = cstmt.getInt(3);      // Rows

The PL/SQL Function is declared as following:

  function checkArea(pi_area     in  number,
                     po_rows     out number) return number;
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.