]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-17408 DML: new sql_modulo() method for oracle
authorskodak <skodak>
Wed, 26 Nov 2008 08:44:57 +0000 (08:44 +0000)
committerskodak <skodak>
Wed, 26 Nov 2008 08:44:57 +0000 (08:44 +0000)
lib/dml/oci8po_adodb_moodle_database.php

index c25e501d10cfea158afc820a2f14bbff521957b7..ab7c084da5df3449d5fbde81d8a07d0f1265b658 100644 (file)
@@ -173,6 +173,18 @@ class oci8po_adodb_moodle_database extends adodb_moodle_database {
         return '((' . $int1 . ') # (' . $int2 . '))';
     }
 
+    /**
+     * Returns the SQL text to be used in order to perform module '%'
+     * opration - remainder after division
+     *
+     * @param integer int1 first integer in the operation
+     * @param integer int2 second integer in the operation
+     * @return string the piece of SQL code to be used in your statement.
+     */
+    public function sql_modulo($int1, $int2) {
+        return 'MOD(' . $int1 . ', ' . $int2 . ')';
+    }
+
     function sql_null_from_clause() {
         return ' FROM dual';
     }