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">
<html>
<head>
  <meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
  <title></title>
</head>
<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>
  </tt></blockquote>
This Java statement<br>
<blockquote>resultSet = statement.executeQuery( selectSql );<br>
</blockquote>
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>
</blockquote>
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>
<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>
</blockquote>
<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>
</div>
</body>
</html>

Mime
View raw message