Re: [Zope] Python formatting question
21 Jul
2005
21 Jul
'05
4:41 p.m.
hpinson@indepthl.com wrote:
In a Python script, how can I break up a SQL statement over more than one line? For example, to transform
#generate the sql statement sql="DELETE FROM tblUsers WHERE user_name LIKE '%'"
to:
#generate the sql statement sql="DELETE FROM tblUsers WHERE user_name LIKE '%'"
...does not work. Is there a way to break lines?
Any example would be appreciated.
Python allows you to you triple-quotes to include line breaks in the string:: sql="""DELETE FROM tblUsers WHERE user_name LIKE '%'""" Take a look at the python.org tutorial or diveintopython.org. --jcc
7563
Age (days ago)
7563
Last active (days ago)
0 comments
1 participants
participants (1)
-
J Cameron Cooper