[SQL] Right way to set a variable to NULL?
martin at marcher.name
Fri Dec 26 21:42:34 CET 2008
I'd create a simple wrapper object
def __init__(self, address=None):
self.address = address
you can keep most of your code just replace the original instantiation
of the mail str-instance with the MailAddress
This is just scratched up quickly. Hope it helps
2008/12/26 Gilles Ganault <nospam at nospam.com>:
> sql = 'INSERT INTO mytable (name,address,web,mail) VALUES
> ("%s","%s","%s","%s","%s")' % (name,address,web,mail)
> Is there a better way in Python to have a variable match NULL than
> building the SQL query step by step?
> Thank you.
You are not free to read this message,
by doing so, you have violated my licence
and are required to urinate publicly. Thank you.
Please avoid sending me Word or PowerPoint attachments.
More information about the Python-list