From: stronk7 Date: Thu, 31 Aug 2006 00:19:57 +0000 (+0000) Subject: Minor modifications to oci8po generator (max 38 for number) X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=4782a1f8bc54a25962d0af07e16b93fd8923bbec;p=moodle.git Minor modifications to oci8po generator (max 38 for number) --- diff --git a/lib/xmldb/classes/generators/oci8po/oci8po.class.php b/lib/xmldb/classes/generators/oci8po/oci8po.class.php index 0a8f277999..3055ae5a89 100644 --- a/lib/xmldb/classes/generators/oci8po/oci8po.class.php +++ b/lib/xmldb/classes/generators/oci8po/oci8po.class.php @@ -77,6 +77,10 @@ class XMLDBoci8po extends XMLDBgenerator { break; case XMLDB_TYPE_NUMBER: $dbtype = $this->number_type; + /// 38 is the max allowed + if ($xmldb_length > 38) { + $xmldb_length = 38; + } if (!empty($xmldb_length)) { $dbtype .= '(' . $xmldb_length; if (!empty($xmldb_decimals)) { @@ -138,7 +142,7 @@ class XMLDBoci8po extends XMLDBgenerator { $trigger.= "\nON " . $this->getEncQuoted($this->prefix . $xmldb_table->getName()); $trigger.= "\n FOR EACH ROW"; $trigger.= "\nBEGIN"; - $trigger.= "\n IF :old." . $this->getEncQuoted($xmldb_field->getName()) . ' IS NOT NULL THEN'; + $trigger.= "\n IF :new." . $this->getEncQuoted($xmldb_field->getName()) . ' IS NULL THEN'; $trigger.= "\n SELECT " . $sequence_name . '.nextval INTO :new.' . $this->getEncQuoted($xmldb_field->getName()) . " FROM dual;"; $trigger.= "\n END IF;"; $trigger.= "\nEND;";