db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alan M. Feldstein" <afel...@earthlink.net>
Subject WHERE clause
Date Wed, 29 Nov 2006 02:36:38 GMT
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  <meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
<body bgcolor="#ffffff" text="#000000">
jdb shows me the SQL that Derby sees<br>
<blockquote><tt>Thread-1[1] print selectSql<br>
 selectSql = "SELECT * FROM "ADDTestCasesResults" WHERE "chipRelease" =
'Sputnik001' AND "testCaseID" = 1"<br>
Thread-1[1] <br>
This Java statement<br>
<blockquote>resultSet = statement.executeQuery( selectSql );<br>
then fails with<br>
<blockquote><font color="#ff0000">ERROR 42X04: Column 'SPUTNIK001' is
either not in any table in the FROM list or ...</font><br>
Apparently, Derby thinks that 'Sputnik001' is a column name, failing to
recognize that it is a character string to be compared with each row in
the "chipRelease" column.<br>
If you need to see the Java code that assigned to the selectSql
variable, it is<br>
<blockquote><tt>selectSql = "SELECT * FROM \"ADDTestCasesResults\"
WHERE \"chipRelease\" = \'" + simulationResult.getChipRelease() + "\'
AND \"testCaseID\" = " + Long.toString(
simulationResult.getTestCaseID() );</tt><br>
<div class="moz-signature">-- <br>
<meta name="generator"
 content="HTML Tidy for Solaris (vers 1st March 2004), see www.w3.org">
<title>Alan M. Feldstein</title>
<p>Alan Feldstein</p>
<img src="cid:part1.05060104.07090402@earthlink.net"
 alt="Cosmic Horizon logo" height="55" width="101">
<p><a href="http://www.alanfeldstein.com/">http://www.alanfeldstein.com/</a></p>

View raw message