Results 1 to 8 of 8

Thread: SQL Error

  1. #1
    Sno's Avatar
    Sno
    Sno is offline Senior Member
    Join Date
    Apr 2010
    Posts
    196
    Rep Power
    5

    Default SQL Error

    Seems basic, but I keep getting Invalid Character

    Java Code:
    Connection con = Utility.getOracleConnection();
    String SQL = "SELECT ORDERED FROM AGG_SLR_SUMMARY;";
    Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);
    ResultSet rs = stmt.executeQuery(SQL);

    Error:

    Java Code:
    16:38:28,010 INFO  [STDOUT] SQLException() - ORA-00911: invalid character
    16:38:28,010 INFO  [STDOUT] java.sql.SQLSyntaxErrorException: ORA-00911: invalid character
    If I change this statement without the ;

    Java Code:
    String SQL = "SELECT ORDERED FROM AGG_SLR_SUMMARY";
    I get the error

    Java Code:
    16:28:51,807 INFO  [STDOUT] SQLException() - ORA-00942: table or view does not exist
    16:28:51,807 INFO  [STDOUT] java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist
    I've connected to this database before with a CallableStatement for a package.procedure...

    Am I missing something here?
    :rolleyes: ~ Sno ~ :rolleyes:
    '-~ B.S. Computer Science ~-'

  2. #2
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,430
    Rep Power
    7

    Default

    String SQL = "SELECT ORDERED FROM AGG_SLR_SUMMARY;";

    That semicolon inside the sql String seems very suspicious.

    Did you forget an owner/ schema name?
    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

  3. #3
    Sno's Avatar
    Sno
    Sno is offline Senior Member
    Join Date
    Apr 2010
    Posts
    196
    Rep Power
    5

    Default

    owner/ schema name which you reference is in the Utility.getOracleConnection(); method that I call.

    I am not at work anyone, which I was doing this, looking back at my personal project code. This worked for me in the past
    Java Code:
    //PHPmyAdmin Database
    Statement st = conn.createStatement();
    ResultSet res = st.executeQuery("SELECT * FROM  `eossysdef`;"); // SQL Grab Table
    i'll try that tomorrow, and I have played with that semi-colon, it was suspicious to me as well.
    :rolleyes: ~ Sno ~ :rolleyes:
    '-~ B.S. Computer Science ~-'

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,755
    Rep Power
    19

    Default

    The PHPMyAdmin driver is probably quite lenient.
    The semi-colon isn't needed.

    Anyway, "table or view doesn't exist" is pretty clear.
    Ensure you are looking at the correct db.
    Ensure that db has that table.
    Is that table part of the user schema you are logged in as?
    If not then I'd recommend, as already suggested, adding the schema name in the query.

  5. #5
    Sno's Avatar
    Sno
    Sno is offline Senior Member
    Join Date
    Apr 2010
    Posts
    196
    Rep Power
    5

    Default

    ... I think I found my problem. Yesterday morning before I dropped an xml file named oracle-ds.xml that held my QA database info. I ended up overwriting my development database info.

    So I'm about to determine if that was the actual issue.
    :rolleyes: ~ Sno ~ :rolleyes:
    '-~ B.S. Computer Science ~-'

  6. #6
    Sno's Avatar
    Sno
    Sno is offline Senior Member
    Join Date
    Apr 2010
    Posts
    196
    Rep Power
    5

    Default

    Yup. It was exactly the overwrite I perform yesterday.
    :rolleyes: ~ Sno ~ :rolleyes:
    '-~ B.S. Computer Science ~-'

  7. #7
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,430
    Rep Power
    7

    Default

    Solved?:rolleyes:
    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

  8. #8
    Sno's Avatar
    Sno
    Sno is offline Senior Member
    Join Date
    Apr 2010
    Posts
    196
    Rep Power
    5

    Default

    Totally!!1!
    :rolleyes: ~ Sno ~ :rolleyes:
    '-~ B.S. Computer Science ~-'

Similar Threads

  1. java out of memory error-heap space error
    By elsanthosh in forum NetBeans
    Replies: 4
    Last Post: 06-15-2010, 09:31 AM
  2. Replies: 1
    Last Post: 03-10-2010, 01:53 PM
  3. Replies: 1
    Last Post: 12-05-2009, 07:28 AM
  4. Replies: 1
    Last Post: 10-26-2009, 04:38 PM
  5. Replies: 3
    Last Post: 01-23-2009, 08:53 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •