Hi,
 
I'm trying to run a query and it will not work properly. in mysql I have two tables and I run the following query:
 
mysql> select deviceID, description from terminal, deviceType where deviceType.deviceType = terminal.deviceType;
+----------+-------------+
| deviceID | description |
+----------+-------------+
| 57685251 | PSTN        |
| 57685251 | PSTN        |
| 22671300 | ISDN        |
| 90098999 | GSM         |
| 95755499 | GSM         |
+----------+-------------+
5 rows in set (0.00 sec)
 
When I try to run it on a xsp page (see code at the bottom of the page) I get the following result:
 
Device ID Description
90098999 PSTN
95755499 PSTN
57685251 PSTN
22671300 PSTN
57685251 PSTN
90098999 ISDN
95755499 ISDN
57685251 ISDN
22671300 ISDN
57685251 ISDN
90098999 GSM
95755499 GSM
57685251 GSM
22671300 GSM
57685251 GSM

As far as I can see the where condition is not working when I run it in the xsp page (as you can see below this is the result when the query is run without the condition).
 
mysql> select deviceID, description from terminal, deviceType;
+----------+-------------+
| deviceID | description |
+----------+-------------+
| 90098999 | PSTN        |
| 95755499 | PSTN        |
| 57685251 | PSTN        |
| 22671300 | PSTN        |
| 57685251 | PSTN        |
| 90098999 | ISDN        |
| 95755499 | ISDN        |
| 57685251 | ISDN        |
| 22671300 | ISDN        |
| 57685251 | ISDN        |
| 90098999 | GSM         |
| 95755499 | GSM         |
| 57685251 | GSM         |
| 22671300 | GSM         |
| 57685251 | GSM         |
+----------+-------------+
15 rows in set (0.00 sec)
What's the problem? Is there something special about the esql syntax? Or is it something else?
 
Anybody who can figure it out?
 
/Anne Marie
 
 
<esql:execute-query>
    <esql:query>
      select deviceID, description from terminal, deviceType where deviceType.deviceType = terminal.deviceType;
    </esql:query>
    <esql:results>
      <header>
        These are your definitions:
      </header>
      <esql:row-results>
        <definition>
          <ID>
            <esql:get-string column="deviceID"/>
          </ID>
          <desc>
            <esql:get-string column="description"/>
          </desc>
        </definition>
      </esql:row-results>
      <footer>
        End of list
      </footer>
    </esql:results>
  </esql:execute-query>
 
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>

Reply via email to