FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

Oracle with JAVA - Invalid Character

 


NewGuyinTown
executeQuery( "SELECT * FROM \"activity\";" )

returns "ORA-00911: invalid character (in oracle.jdbc.driver.DatabaseError)"

The code worked before with mySQL and I tried to make it portable with an Oracle database.

For some reason, quotations are treated as invalid characters when it is executed by JAVA.

However, I executed that query (without the "\") from the SQL Command Line, it works. Without the quotations, it return "tables or views does not exist" (different output from the output with quotations: no rows selected).

I don't know how to perform a query if quotations are forbidden...

Any advices/help appreciated.
shamil
Try executeQuery( "SELECT * FROM activity;" )
FunDa
Try
executeQuery( "SELECT * FROM \'activity\';" )
NewGuyinTown
shamil wrote:
Try executeQuery( "SELECT * FROM activity;" )


FunDa wrote:
Try
executeQuery( "SELECT * FROM \'activity\';" )


Both throws an Exception saying "tables or views does not exist" like the query in the SQL Command Line.
shamil
NewGuyinTown wrote:
shamil wrote:
Try executeQuery( "SELECT * FROM activity;" )


FunDa wrote:
Try
executeQuery( "SELECT * FROM \'activity\';" )


Both throws an Exception saying "tables or views does not exist" like the query in the SQL Command Line.
I forgot to remove semicolon. Remove semicolon and try again.
executeQuery( "SELECT * FROM activity" );
FunDa
FunDa wrote:
Try
executeQuery( "SELECT * FROM \'activity\';" )


I forgot that too ....

Try

Try
executeQuery( "SELECT * FROM \'activity\'\;" )
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.