[Zope-DB] optional argument, can it be an empty string

Kevin Gill Kevin.Gill at newaddress.ie
Fri Nov 5 14:49:35 EST 2004


I have a table with forty fields. I use a single Z SQL Method, from different places in my code, passing different parameters.

<params>AccountId ControlClientId:optional  Mobile:optional </params>

update MyAccount 
set
    <dtml-if ControlClientId>
        ControlClientId = <dtml-sqlvar ControlClientId type=int>,
    </dtml-if>
    <dtml-if Mobile>
        Mobile = <dtml-sqlvar Mobile type=string>,
    </dtml-if>
    accountid = <dtml-sqlvar accountid type=int>
where 
    accountid = <dtml-sqlvar accountid type=int>


When I pass in an empty 'Mobile', the above code does not distinguish this from an empty string, and the database column is not updated.

Can I detect whether an string was passed in, even if it is empty?

Thanks in Advance

Kevin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope-db/attachments/20041105/6c4df0ab/attachment.htm


More information about the Zope-DB mailing list