[Zope-DB] Optional "Order By" clause

Jim Penny jpenny at universal-fasteners.com
Thu Jul 15 10:54:37 EDT 2004


On Thu, 15 Jul 2004 11:13:59 +0100
Philip Kilner <phil at xfr.co.uk> wrote:

> Hi List,
> 
> Stuck on syntax again!
> 
> Am trying to make an optional order-by clause, using "dtml-sqlgroup".
> 
> The following: -
> 
> <dtml-sqlgroup order by>
>    <dtml-sqlvar OrderBy type="nb" optional>
> </dtml-sqlgroup>

<dtml-if OrderBy>
  <dtml-var OrderBy sql_quote>
</dtml-if>

Note:  I am not sure that this is 100% sql-injection safe.  However,
sql_quote should give you quite a bit of protection.

Jim

> 
> ...is incorrect, but probably shows what I'm trying to do.
> 
> I've only previously used dtml-sqlgroup for "where" - can I even use
> it for order by? I don't know whether to interpret the absence of
> examples as a "no" to that, or to...an absence of examples!
> 
> If not, how should I address this?
> 
> All hints gratefully received!
> 
> -- 
> 
> Regards,
> 
> PhilK
> 
> Email: phil at xfr.co.uk / Voicemail & Facsimile: 07092 070518
> 
> "The lyf so short, the craft so long to learne" - Chaucer
> 
> 
> _______________________________________________
> Zope-DB mailing list
> Zope-DB at zope.org
> http://mail.zope.org/mailman/listinfo/zope-db
> 
> 


More information about the Zope-DB mailing list