Results 1 to 7 of 7

Thread: Invalid SQL character error with "$"

  1. #1
    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?

  2. #2
    Join Date
    May 2008
    Posts
    685

    Re: Invalid SQL character error with "$"

    It takes specialized characters '&' (and other special characters) by inserting a '\' before.

  3. #3
    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.

  4. #4
    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.

  5. #5
    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'

  6. #6
    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)

  7. #7
    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.

Similar Threads

  1. Replies: 6
    Last Post: 21-04-2012, 03:00 PM
  2. Getting "INVALID CPU TYPE OR SPEED" error with ASRock Z68 Extreme3 Gen3
    By Maryland in forum Motherboard Processor & RAM
    Replies: 3
    Last Post: 10-04-2012, 11:53 AM
  3. Replies: 4
    Last Post: 13-11-2009, 07:17 PM
  4. Replies: 3
    Last Post: 30-07-2009, 08:40 PM
  5. Replies: 2
    Last Post: 13-06-2009, 03:37 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,927,290.84787 seconds with 16 queries