From 415c4f78f3b99fcbdfd4d0a385eb05f1d2c2f058 Mon Sep 17 00:00:00 2001 From: skodak Date: Wed, 26 Nov 2008 08:44:57 +0000 Subject: [PATCH] MDL-17408 DML: new sql_modulo() method for oracle --- lib/dml/oci8po_adodb_moodle_database.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/dml/oci8po_adodb_moodle_database.php b/lib/dml/oci8po_adodb_moodle_database.php index c25e501d10..ab7c084da5 100644 --- a/lib/dml/oci8po_adodb_moodle_database.php +++ b/lib/dml/oci8po_adodb_moodle_database.php @@ -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'; } -- 2.39.5