[Zope] setting 'arguments' string dynamically in a ZSQL method
Holger Lehmann
lehmann@catworkx.de
Fri, 8 Jun 2001 12:37:48 +0200
Hi Chas,
why not trying this:
(assuming three hardcoded parameters)
<dtml-in "YourSQLMethod(param1=3Dvalue1,param2=3Dvalue2,param3=3DNone)">
and another time:
<dtml-in "YourSQLMethod(param1=3Dvalue5,param2=3D_['variable10'],param3=3D=
value4)">
with something like this in your ZSQLMethod:
params:
param1, param2, param3
sql (warning untested):
<dtml-if "param3!=3D'None'">
select * from foo where .....=20
<dtml-else>
select * from bar where ....
</dtml-if>
**and** set the advanced setting " max rows retreived " to 0 (zero) to st=
op=20
the ZSQLMethod from appending SQL code to your statement dynamically.
- Holger
Am Freitag, 8. Juni 2001 11:58 schrieb Chas Wareing:
> I've been spending way too much time on this--
>
> I'd like to set the 'arguments' string while calling a ZSQL method
> instead of hardcoding it on the method- my variable names are dynamic
>
> a namespace hack or zsql product patch would be appreciated-
>
> I'm using this for a generic/reusable qryInsert object-
>
> Chas. <c3w@ISP.NET>
> ISP Networks, Inc.
>
> _______________________________________________
> Zope maillist - Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> ** No cross posts or HTML encoding! **
> (Related lists -
> http://lists.zope.org/mailman/listinfo/zope-announce
> http://lists.zope.org/mailman/listinfo/zope-dev )
--=20
-----------------------------------
catWorkX GmbH
Dipl.-Ing. Holger Lehmann
Stresemannstr. 364
22761 Hamburg
Tel: +49 (0700) catWorkX
Tel: +49 (40) 890 646-0
Fax: +49 (40) 890 646-66
mailto:lehmann@catworkx.de
http://www.catworkx.de
http://www.catbridge.de