0

I am using Java Class in which I am connecting to a database to execute store procedure. While executing I am receiving below error.

Error: "PLS-00201: identifier 'SPUPDATEVALIDATIONGTA' must be declared"

Java Code:

private final String SPUPDATE_VALIDATIONGTA_QUERY = "begin spUpdateValidationGTA(?,?,?); end;";

private void invokeSPUpdateValidationGTA(LoadTO loadTO) throws DataloadException {
    boolean isAdminData = loadTO.isCategoryAdmin();
    CallableStatement stmt = null;
    int adminData = 0;
    Trace.trace("dataload", "AutoDataLoad.invokeSPUpdateValidationGTA()", " Starting:: loadTO:" +     loadTO,
            Trace.PRODUCTION);

    try {
        // prepare procedure call
        stmt = GTAconnection.prepareCall(SPUPDATE_VALIDATIONGTA_QUERY);

        // set the in param
        stmt.setLong(1, loadTO.getTrackingNumber());
        // Due to a restriction in the OCI layer, the JDBC drivers do
        // not support the passing of BOOLEAN parameters to PL/SQL stored
        // procedures. So changed it to int.`your text`
        if (isAdminData) {
            adminData = 1;
        } else {
            adminData = 0;
        }
        stmt.setInt(2, adminData);
        stmt.setString(3, APPLICATION_LEVEL);
}

Could you please help me to understand what was the mistake I am making to resolve the issue?

MT0
  • 143,790
  • 11
  • 59
  • 117
  • 1
    Does this answer your question? [PLS-00201 - identifier must be declared](https://stackoverflow.com/questions/23526870/pls-00201-identifier-must-be-declared) – MT0 Aug 04 '23 at 10:25
  • Either the stored procedure ˋspUpdateValidationGTA` does not exist or it is in a schema different from the user used from Java. – Codo Aug 04 '23 at 10:26
  • Either: the procedure you are calling does not exist (i.e. you have mistyped something or forgot to create it); or it exists but is not in the schema you are connected to (in which case prefix the procedure name with the schema name); or it exists but you do not have the privileges to see it (grant the user you are connecting to the execute privileges on that procedure). All of which is covered in different answers in that linked duplicate. – MT0 Aug 04 '23 at 10:28
  • Or it was created with double quotes and mixed case, in which case it would need to be called with double quotes and matching mixed case. – Paul W Aug 04 '23 at 12:23
  • Unable to understand the below procedure. Can anyone please help me to understand Procedure Name: DATEDIFF. create or replace FUNCTION DATEDIFF( p_what in varchar2, p_d1 in date, p_d2 in date ) RETURN NUMBER AS l_result number; BEGIN SELECT (p_d2-p_d1) * decode( upper(p_what), 'SS', 24*60*60, 'MI', 24*60, 'HH', 24, NULL ) INTO l_result FROM DUAL; RETURN l_result; END; – Krishna Rohith Aug 11 '23 at 12:23

0 Answers0