[Zope] SQL compare to form value -HELP-
Dieter Maurer
dieter@handshake.de
Sun, 10 Mar 2002 19:34:58 +0100
This was not a "zope-dev" question...
I removed it.
Sean Kelley writes:
> I am trying to test whether or not 3 SQL fields are equal to a form
> field. I am doing this within an SQL method. (I am trying to learn
> zope and Mysql at the sam time) How does one do this? Here is where I
> am going with this so far:
> I have these listed as arguments: Breeds Breed1 Breed2 Breed3
>
> SELECT * from Ranch
> WHERE Breeds = <dtml-sqltest name="Breed1" type="string"> OR Breeds =
> <dtml-sqltest name="Breed2" type="string">
> or Breeds = <dtml-sqltest name="Breed3" type="string">
Not sure whether MySQL supports this type of query, but
usually you could use:
WHERE Breeds in (Breed1, Breed2, Breed3)
BTW: "dtml-sqltest" is wrong above. As the name suggests, "sqltest"
performs a test, but you use it as a variable above. For such
cases, use "dtml-sqlvar".
Dieter