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
WHy do you want to pass "?" ?
Tamil
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
Forum Rules
Click Here to Expand Forum to Full Width
Bookmarks