commit-gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

r5149 - trunk/gnue-common/src/schema/scripter/processors


From: johannes
Subject: r5149 - trunk/gnue-common/src/schema/scripter/processors
Date: Tue, 24 Feb 2004 01:46:48 -0600 (CST)

Author: johannes
Date: 2004-02-24 01:46:46 -0600 (Tue, 24 Feb 2004)
New Revision: 5149

Modified:
   trunk/gnue-common/src/schema/scripter/processors/oracle.py
Log:
Fixed trigger-code, datetime- and string-translation and quoting of
default-values.


Modified: trunk/gnue-common/src/schema/scripter/processors/oracle.py
===================================================================
--- trunk/gnue-common/src/schema/scripter/processors/oracle.py  2004-02-24 
06:10:55 UTC (rev 5148)
+++ trunk/gnue-common/src/schema/scripter/processors/oracle.py  2004-02-24 
07:46:46 UTC (rev 5149)
@@ -72,7 +72,7 @@
 
     # add a given 'constant' as default value 
     elif hasattr (gsField, "default") and gsField.default is not None:
-      field += " DEFAULT %s" % gsField.default
+      field += " DEFAULT '%s'" % gsField.default
 
     if not gsField.nullable:
       field += " NOT NULL"
@@ -93,7 +93,7 @@
     epi.append ("CREATE OR REPLACE TRIGGER t__%s_%s_pre" % (tableDef.name,
                gsField.name))
     epi.append ("  BEFORE INSERT ON %s" % tableDef.name)
-    epi.append ("  FOR EACH ROW WHEN (:new.%s IS NULL)" % gsField.name)
+    epi.append ("  FOR EACH ROW WHEN (new.%s IS NULL)" % gsField.name)
     epi.append ("  BEGIN")
     epi.extend (body)
     epi.append ("  END;")
@@ -116,7 +116,7 @@
     if hasattr (gsField, 'length') and gsField.length <= 2000:
       return "varchar2 (%s)" % gsField.length
     else:
-      return "long"
+      return "blob"
 
 
   # ---------------------------------------------------------------------------
@@ -130,7 +130,17 @@
     return "date"
 
 
+  # ---------------------------------------------------------------------------
+  # datetime becomes 'date'
+  # ---------------------------------------------------------------------------
 
+  def datetime (self, gsField):
+    """
+    Datetime translates to 'date'
+    """
+    return "date"
+
+
   # ---------------------------------------------------------------------------
   # A key is a number of _PK_PRECISION
   # ---------------------------------------------------------------------------





reply via email to

[Prev in Thread] Current Thread [Next in Thread]