[Zope-dev] My ZSql method return the result of Query!

Phil Harris phil.harris@zope.co.uk
Thu, 20 Jan 2000 10:23:39 -0000


Victor,

You need to change the last bit of your equation.

Assuming a table layout of
id, Firstname, Lastname, Company etc..

<dtml-var standard_html_header>
<table border=0 cellpadding=2 cellspacing=0>
<tr>
  <th>ID</th>
  <th>First Name</th>
  <th>Last Name</th>
  <th>Company</th>
</tr>
<dtml-in sqlQueryCustomer>
  <tr>
    <td><dtml-var id></td>
    <td><dtml-var Firstname></td>
    <td><dtml-var Lastname></td>
    <td><dtml-var Company></td>
  </tr>
</dtml-in>
<h3>This is <dtml-var customer_id> was queried.</h3>
<dtml-var standard_html_footer>

Or something very similar.

Phil
phil.harris@zope.co.uk


|>-----Original Message-----
|>From: zope-dev-admin@zope.org [mailto:zope-dev-admin@zope.org]On Behalf
|>Of Victor.Zhai@ogilvy.com
|>Sent: Thursday, January 20, 2000 9:58 AM
|>To: zope-dev@zope.org
|>Subject: [Zope-dev] My ZSql method return the result of Query!
|>
|>
|>
|>Hi,all
|> I query from a DTML Method that call the ZSql method like this:
|>ZSQl method named "sqlQueryCustomer":
|>           select * from customers
|>           where customer_id = <dtml-sqlvar customer_id type=string>
|>It can work by using TEST.
|>But I want to use it through one DTML Document named "QueryCustomer": <The
|>one which I query interface>
|>               <dtml-var standard_html_header>
|>               <h2><dtml-var title_or_id></h2>
|>               <form action="dtPerformQueryCustomer">
|>          <table>
|>           <tbody>
|>            <tr>
|>                <th aligh="left">Customer ID</th>
|>                 <td><input type="text" name="customer_id"></td>
|>           </tr>
|>           </tbody>
|>          </table>
|>          <input type="submit" value="Query Customer">
|>          </form>
|>          </table>
|>          </form>
|>My DTML Method named "dtPerformQueryCustomer":
|>          <dtml-var standard_html_header>
|>          <dtml-call sqlQueryCustomer>
|>          <h3>This is <dtml-var customer_id> was queried.</h3>
|>          <dtml-var standard_html_footer>
|>It can only return "This is XXX was queried".And cannot return
|>the result like "*** **** *** ***".
|>What is the problem, Give me your hand.
|>Thanks a lot.
|>
|>
|>
|>"WorldSecure Server <ogilvy.com>" made the following
|> annotations on 01/20/00 04:55:42
|>------------------------------------------------------------------
|>------------
|>Privileged/Confidential Information may be contained in this
|>message.  If you are not the addressee indicated in this message
|>(or responsible for delivery of the message to such person), you
|>may not copy or deliver this message to anyone. In such case, you
|>should destroy this message and kindly notify the sender by reply
|>email. Please advise immediately if you or your employer does not
|>consent to email for messages of this kind.  Opinions,
|>conclusions and other information in this message that do not
|>relate to the official business of the Ogilvy Group shall be
|>understood as neither given nor endorsed by it.
|>
|>==================================================================
|>============
|>
|>
|>_______________________________________________
|>Zope-Dev maillist  -  Zope-Dev@zope.org
|>http://lists.zope.org/mailman/listinfo/zope-dev
|>**  No cross posts or HTML encoding!  **
|>(Related lists -
|> http://lists.zope.org/mailman/listinfo/zope-announce
|> http://lists.zope.org/mailman/listinfo/zope )
|>