return ' CONCAT('. $firstname .'," ",'. $lastname .') ';
case 'postgres7':
return " ". $firstname ."||' '||". $lastname ." ";
+ case 'mssql':
+ return " ". $firstname ."+' '+". $lastname ." ";
default:
return ' '. $firstname .'||" "||'. $lastname .' ';
}
}
}
+/**
+ * Returns the proper AS keyword to be used to aliase columns
+ * SQL defines the keyword as optional and nobody but PG
+ * seems to require it. This function should be used inside all
+ * the statements using column aliases.
+ * Note than the use of table aliases doesn't require the
+ * AS keyword at all, only columns for postgres.
+ * @uses $CFG
+ * @ return string the keyword
+ */
+function sql_as() {
+ global $db;
+
+ switch ($CFG->dbtype) {
+ case 'postgres7':
+ return 'AS';
+ default:
+ return '';
+ }
+}
+
/**
* Prepare a SQL WHERE clause to select records where the given fields match the given values.
*
return $rs->MetaType($field->type);
}
+
/**
* This function, called from setup.php includes all the configuration
* needed to properly work agains any DB. It setups connection encoding