Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 21-01-2009
Member
 
Join Date: Nov 2008
Posts: 3,952
Invalid SQL character error with "$"

I'm trying to make a request for java (jdbc) on a table that contains $ in the name, and I get an error of invalid sql character.

Is there a way to avoid such errors?
Reply With Quote
  #2  
Old 21-01-2009
Member
 
Join Date: May 2008
Posts: 685
Re: Invalid SQL character error with "$"

It takes specialized characters '&' (and other special characters) by inserting a '\' before.
Reply With Quote
  #3  
Old 21-01-2009
Member
 
Join Date: Nov 2008
Posts: 3,952
Re: Invalid SQL character error with "$"

But it's the Java compiler! It gives me illegal character usage.

And I can not "Google" for that thing, it ignores the '$' in my research.
Reply With Quote
  #4  
Old 21-01-2009
XSI XSI is offline
Member
 
Join Date: May 2008
Posts: 271
Re: Invalid SQL character error with "$"

In fact, the $ is not a problem in Oracle. If there is one, is it that the Java is something special with $.

Example of SQLPlus:
SELECT * FROM V$DATABASE;
no problem at all.
Reply With Quote
  #5  
Old 21-01-2009
Member
 
Join Date: May 2008
Posts: 685
Re: Invalid SQL character error with "$"

Another idea, display your request before sending it to Oracle.

Note: lower ('system') = 'system'
Reply With Quote
  #6  
Old 21-01-2009
Member
 
Join Date: Nov 2008
Posts: 3,952
Re: Invalid SQL character error with "$"

Quote:
Originally Posted by fellah View Post
Note: lower ('system') = 'system'
Otherwise, I am well before my request, it is correct, but I always have the concerns of char. If I copy / paste in sqlplus, it rolls

Code:
Query: 
select PARENTITEMID from user.DB$17$USERBASE_ATTR where lower(plaintextfragment) = lower('system')

java.sql.SQLException:: ORA-00911: invalid character at oracle.jdbc.driver.SQLStateMapping.newSQLException (SQLStateMapping.java:74)
Reply With Quote
  #7  
Old 21-01-2009
Member
 
Join Date: May 2008
Posts: 685
Re: Invalid SQL character error with "$"

1 - Lower is useless on a string constant already lowercase.

2 - without ';' at the end. The ';' is useful for SQLPlus or PL/SQL to define the commands. But in your context, it is unnecessary.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Invalid SQL character error with "$""
Thread Thread Starter Forum Replies Last Post
Getting error "Could not install. Invalid installation options. Please try again." While installing Diablo III Burarro Video Games 6 21-04-2012 03:00 PM
Getting "INVALID CPU TYPE OR SPEED" error with ASRock Z68 Extreme3 Gen3 Maryland Motherboard Processor & RAM 3 10-04-2012 11:53 AM
Error message "Explorer caused an invalid page fault in PDM.DLL." Aadeshh Operating Systems 4 13-11-2009 07:17 PM
Error for wireless request "Set Mode" (8B06) : invalid argument "roaming" WinSlayer Operating Systems 3 30-07-2009 08:40 PM
"Error 1327.Invalid Drive: K:\" message when installing MS Office CoYoTeA Office Setup 2 13-06-2009 03:37 PM


All times are GMT +5.5. The time now is 10:50 AM.