error while passing parameter to PL/SQL procedure
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: error while passing parameter to PL/SQL procedure

  1. #1
    Join Date
    Jan 2006
    Posts
    3

    error while passing parameter to PL/SQL procedure

    Hello ,

    this is a method wich try to pass a string to simple PL/SQL stored procedure:

    public static void call_AudStatscrutJOB(String objectName){

    ResultSet ping = null;
    boolean test1 = false;
    // CallableStatement cstmt = null;
    PreparedStatement cstmt = null;
    float nb_statement=0;

    TestConnection conn = new TestConnection();
    Connection connection = null;

    try{
    connection=conn.connect();
    if (connection != null)
    {
    cstmt = connection.prepareStatement("{call manage_pak.test2(?)}");
    cstmt.setString(1,"EMP");
    cstmt.addBatch();
    cstmt.executeBatch();
    }
    else System.out.println("Connection closed");

    }
    catch (SQLException sqle) {sqle.printStackTrace();}
    try{
    if ( !connection.isClosed() )
    {
    connection.close();
    }
    }
    catch (SQLException sqle) {sqle.printStackTrace();}
    }

    i've got this probleme when calling the procedure:

    ORA-00911: caractère non valide

    I try the same code without passing parameter, it works. I think the probleme is about the '?' caracter. Someone can help me please

  2. #2
    Join Date
    May 2000
    Location
    ATLANTA, GA, USA
    Posts
    3,136
    WHy do you want to pass "?" ?

    Tamil

  3. #3
    Join Date
    Jan 2006
    Posts
    3
    well , in fact, i want to pass a string : "EMP". But i see that to pass parameters to a PL/SQL procedure from java programme, we must bind the parameter with the '?' caracter when we call the procedure

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width