[Zope-DB] sqltest and sqlgroup

Smith, Neil Neil.Smith@npower.com
Wed, 16 Jan 2002 11:25:47 -0000


Thanks for the answers.

Just to recap, sqlgroup and sqltest do work, but the examples given in the
documentation (Zope Book and others) are not sufficiently clear about when
sqltest renders something and when it doesn't.

In case anyone else gets caught out by this I believe that it works as
follows:

For all types, if the variable doesn't exist, sqltest doesn't render
anything.

Sqltest renders the clause for strings if the variable exists, even if it is
null.  This can be avoided by using type=nb instead of type=string, which
renders the clause only if the variable is not null.

For type=int and type=float it will render the clause if the variable exists
and is not null.  If the variable is null it does not render the clause, but
note that this means that you have to pass a text variable into it otherwise
a null would not be accepted (i.e don't declare an argument to the sql
method like myArgument:int).  It does render the clause if the variable is
zero, probably not surprising, but not to be confused with the behaviour of
dtml-if.

Do people writing the documentation read this list, or is it worth raising
this against the documentation separately? 

--------------------------------------------------
Neil Smith
nPower, Oak House, Worcester
Tel: (01905) 340466
mailto:neil.smith@npower.com
**********************************************************************
 
The information contained in this e-mail is confidential and intended only for the use of the addressee. If the reader of this message is not the addressee, you are hereby notified that you have received this e-mail in error and you must not copy, disseminate, distribute, use or take any action as a result of the information contained in it.
    
If you have received this e-mail in error, please notify postmaster@npower.com (UK 01384 275454) and delete it immediately from your system.
    
Neither Npower nor any of the other companies in the Innogy group from whom this e-mail originates accept any responsibility for losses or damage as a result of any viruses and it is your responsibility to check attachments (if any) for viruses.

Npower Limited
Registered office: Windmill Hill Business Park, Whitehill Way, Swindon SN5 6PB. Registered in England and Wales: number 3653277

This e-mail may be sent on behalf of a member of the Innogy plc group of companies.

**********************************************************************