Adding new sql_null_from_clause() helper function from 19_STABLE. MDL-13861

This commit is contained in:
stronk7 2008-06-26 18:27:22 +00:00
parent 5e581dd487
commit f3700f8cb3
2 changed files with 13 additions and 0 deletions

View File

@ -1199,6 +1199,15 @@ abstract class moodle_database {
return '((' . $int1 . ') ^ (' . $int2 . '))';
}
/**
* Returns the FROM clause required by some DBs in all SELECT statements
* To be used in queries not having FROM clause to provide cross_db
* Most DBs don't need it, hence the default is ''
*/
public function sql_null_from_clause() {
return '';
}
/**
* Returns the SQL to be used in order to CAST one CHAR column to INTEGER.
*

View File

@ -166,6 +166,10 @@ class oci8po_adodb_moodle_database extends adodb_moodle_database {
return '((' . $int1 . ') # (' . $int2 . '))';
}
function sql_null_from_clause() {
return ' FROM dual';
}
public function sql_cast_char2int($fieldname, $text=false) {
if (!$text) {
return ' CAST(' . $fieldname . ' AS INT) ';