[Zope-DB] Calling SQL Query in DTML Method with a string argument

Matylda Sawicka vial.of.black.dye at gmail.com
Mon Jul 28 10:59:45 EDT 2008

I am a fresh Zope Explorer. I was trying to call an SQL Query that requires
an argument in a DTML Method that would be called with an argument passed in
the URL. The Query looks more or less like this:

SELECT Uni_Name,
FROM universities
WHERE Uni_Code = <dtml-sqlvar givenCode type="string"> AND
      Uni_Latitude != NULL

whilst the DTML Method consists of:
<dtml-in expr="uniSingleByCode(givenCode='<dtml-var uni_id>')">
<mrk nm="<dtml-var Uni_Name>" lat="<dtml-var Uni_Latitude>" lng="<dtml-var

If I replace the <dtml-var uni_id> with an existing uni code, query works,
but as it is, I get an empty XML (well, just <markers></markers> appear).
I am perfectly aware of the fact that the mistake I make must be trivial,
but nevertheless I'd like to ask for some enlightment.
Best regards,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope-db/attachments/20080728/fa0daa72/attachment.html

More information about the Zope-DB mailing list