Try with this statement to execute % % * strSQL = **"select * from table where fullname like"+" '%"+?+"%' " ;*
Thanks srini On Tue, Jun 23, 2009 at 6:26 AM, JV fis <[email protected]> wrote: > Hello everybody ! Please help me error i'm new in oracle In code java I > write : > PreparedStatement stmt = null; > strSQL = "Select * from table where (FullName like '% ?%') "; > stmt = Connection.prepareStatement(strSQL); > stmt.setString(1,"stringtoSearch") but when Execute error > java.sql.SQLException: Invalid column index > at > oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:111) > at > oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:145) > at > oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:207) > at > oracle.jdbc.driver.OraclePreparedStatement.setStringInternal(OraclePreparedStatement.java:5264) > at > oracle.jdbc.driver.OraclePreparedStatement.setString(OraclePreparedStatement.java:5256) > if I replace '% ?%' with ? not error > > > > > --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/javaprogrammingwithpassion?hl=en -~----------~----~----~----~------~----~------~--~---
