db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Hillegas <Richard.Hille...@Sun.COM>
Subject Re: SQLSyntaxErrorException:
Date Wed, 30 Apr 2008 21:48:55 GMT
Hi Brandon,

I suspect that you need to put single quotes around the string value 
which you want to match in PDFNAME. Something like the following:

  select pdflocation from files where pdfname = 'foo'

Without the single quotes, Derby thinks that foo is the name of a column 
and Derby objects that foo is not a column in the files table.

Hope this helps,
-Rick

Brandon Dohman wrote:
> Wheren running the command below
>  
>  rs = stmnt.executeQuery("SELECT PDFLOCATION from FILES WHERE PDFNAME 
> = " + patron.getPDFName().toLowerCase());
>  
> I'm getting this error message.
>  
>  
> java.sql.SQLSyntaxErrorException: Column 'TESTME' is either not in any 
> table in the FROM list or appears within a join specification and is 
> outside the scope of the join specification or appears in a HAVING 
> clause and is not in the GROUP BY list. If this is a CREATE or ALTER 
> TABLE  statement then 'TESTME' is not a column in the target table.
>         at 
> org.apache.derby.client.am.SQLExceptionFactory40.getSQLException(Unknown 
> Source)
>         at 
> org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
>         at org.apache.derby.client.am.Statement.executeQuery(Unknown 
> Source)
>         at DBServer.conversation.run(conversation.java:691)
>         at java.lang.Thread.run(Thread.java:619)
> Caused by: org.apache.derby.client.am.SqlException: Column 'TESTME' is 
> either not in any table in the FROM list or appears within a join 
> specification and is outside the scope of the join specification or 
> appears in a HAVING clause and is not in the GROUP BY list. If this is 
> a CREATE or ALTER TABLE  statement then 'TESTME' is not a column in 
> the target table.
>         at org.apache.derby.client.am.Statement.completeSqlca(Unknown 
> Source)
>         at 
> org.apache.derby.client.net.NetStatementReply.parsePrepareError(Unknown 
> Source)
>         at 
> org.apache.derby.client.net.NetStatementReply.parsePRPSQLSTTreply(Unknown 
> Source)
>         at 
> org.apache.derby.client.net.NetStatementReply.readPrepareDescribeOutput(Unknown 
> Source)
>         at 
> org.apache.derby.client.net.StatementReply.readPrepareDescribeOutput(Unknown 
> Source)
>         at 
> org.apache.derby.client.net.NetStatement.readPrepareDescribeOutput_(Unknown 
> Source)
>         at 
> org.apache.derby.client.am.Statement.readPrepareDescribeOutput(Unknown 
> Source)
>         at org.apache.derby.client.am.Statement.flowExecute(Unknown 
> Source)
>         at org.apache.derby.client.am.Statement.executeQueryX(Unknown 
> Source)
>         ... 3 more
> I'm not sure why I'm receiving this message.  testme is in the database.
>  
> Could it possibly not be matching on the Case of the piece I'm looking 
> for?  PDFNAME is stored in the database as a VARCHAR
>  


Mime
View raw message