[Zope-DB] Database Data

Lindstrom Greg - glinds Greg.Lindstrom@acxiom.com
Wed, 21 May 2003 12:31:51 -0500


Greetings-
I am using Zope 2.6, mySQL 3.23 with the eGenix myODBC DB adaptor (which I
love!) on Windows 98 and have the following questions.

1.  How can I retrieve data from a database query when I know there is only
1 row to be returned (for example, I have a "users" table)?  Currently, I am
using a <dtml-in...> loop and I feel a little silly.

2.  Can I use the <dtml-sqlgroup> with joins?  For example

	SELECT n.name, a.city FROM Names n, Addresses a <dtml-sqlgroup
where>
	<dtml-sqltest myKey col=n.myKey op=eq type=string>
	<dtml-and>
	   n.myKey = a.myKey
	</dtml-sqlgroup>

	I can't figure out how to do the n.myKey = a.myKey, and I will be
doing a lot of joins.  In fact, I'm going nuts learning all that SQL will do
for me; I've pulled out over 100 lines of python script from my application,
and am looking forward to yanking out even more this weekend.

Thanks for your help.
--greg





**********************************************************************
The information contained in this communication is
confidential, is intended only for the use of the recipient
named above, and may be legally privileged.
If the reader of this message is not the intended
recipient, you are hereby notified that any dissemination, 
distribution, or copying of this communication is strictly
prohibited.
If you have received this communication in error,
please re-send this communication to the sender and
delete the original message or any copy of it from your
computer system. Thank You.