Search code examples
oracle-databasejdbcclob

ORA-06550: line 1, column 13: PLS-00382: expression is of wrong type ORA-06550: line 1, column 7: PL/SQL: Statement ignored


I am trying to call a function with 2 IN parameters and return as CLOB. Having problem with that. I am gettting expression is of wrong type ORA-06550: . Let me know what wrong with this code

 Class.forName("oracle.jdbc.OracleDriver").newInstance();
       String connectionURL = "someurl";



    // Class.forName("com.mysql.jdbc.Driver").newInstance();

     // con=DriverManager.getConnection(connectionURL,"root","root"); 
      con = DriverManager.getConnection(connectionURL);
      callableStatement = con.prepareCall(getmaillist);
      callableStatement.setInt(1, 8498);
      callableStatement.setString(2,"EMAIL");
      out.println("i am at 1");
      callableStatement.registerOutParameter(3,Types.CLOB);
      out.println("i am at 1");
      //callableStatement.setClob(3,clob);
      //callableStatement.registerOutParameter(3, oracle.jdbc.OracleTypes.CURSOR);
      callableStatement.executeQuery();
      out.println("i am at 1");
      rst = (ResultSet) callableStatement.getObject(3);
      out.println("i am at 1");
     // stmt=con.createStatement();

Solution

  • Have you tried:

    ResultSet rs1 = con.createStatement().executeQuery("select get_mail_list(8498,'EMAIL') from dual");
    String strRes = rs1.getString(1);