changeset 334:1e199ea5b846

fixed single-quote inclusion
author Catherine Devlin <catherine.devlin@gmail.com>
date Wed, 08 Apr 2009 10:49:20 -0400
parents 8d5e4ad05a45
children 00b183a103b3
files sqlpython/sqlpyPlus.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/sqlpython/sqlpyPlus.py	Tue Apr 07 15:12:23 2009 -0400
+++ b/sqlpython/sqlpyPlus.py	Wed Apr 08 10:49:20 2009 -0400
@@ -439,11 +439,11 @@
         if datum is None:
             return 'NULL'
         elif isinstance(datum, basestring):
-            return "'%s'" % datum
+            return "'%s'" % datum.replace("'","''")
         try:
             return datum.strftime("TO_DATE('%Y-%m-%d %H:%M:%S', 'YYYY-MM-DD HH24:MI:SS')")
         except AttributeError:
-            return str(datum).replace("'","''")
+            return str(datum)
               
     def output(self, outformat, rowlimit):
         self.tblname = self.tableNameFinder.search(self.querytext).group(1)