[EMAIL PROTECTED] 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


_______________________________________________
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )

Reply via email to