Ora2Pg Migration – Hint: To call a procedure, use CALL.

While converting application from Oracle to PostgreSQL database and if the application uses procedure, following might be one of the exception you should have seen,

Caused by: org.postgresql.util.PSQLException: ERROR: getCalculatedValues() is a procedure

  Hint: To call a procedure, use CALL.

The following line of code might exists in your code base,

callableStmt = connection.prepareCall("{call getCalculatedValues}");

While calling procedures the “call” function should not use curly braces. It works fine in Oracle which is developer friendly and takes care lot such things. In order to work with PostgreSQL remove curly braces in the above code like below.

callableStmt = connection.prepareCall("call getCalculatedValues");

Leave a Reply

Your email address will not be published.

WP2Social Auto Publish Powered By : XYZScripts.com