< Concatenation: Operators   (Previous) Table of Contents (Next)   Concatenation: Formatting Query >

Concatenation: Setting Operator

/**
 * Sets the named property according to which DBMS is in use
 *
 * @return boolean  true if successful.  Does die() if the DBMS is unkown.
 */
function setConcatenationQueryOperator() {
    switch ($this->phptype . ':' . $this->dbsyntax) {
        case 'fbsql:fbsql':
        case 'ibase:firebird':
        case 'oci8:oci8':
        case 'odbc:db2':
        case 'pgsql:pgsql':
        case 'sqlite:sqlite':
        case 'sybase:sybase':
            $this->ConcatenationQueryOperator = ' || ';
            break;
        case 'odbc:access':
        case 'mssql:mssql':
            $this->ConcatenationQueryOperator = ' + ';
            break;
        case 'mysql:mysql':
        case 'mysqli:mysqli':
            $this->ConcatenationQueryOperator = 'CONCAT()';
            break;
        default:
            $this->ConcatenationQueryOperator = false;
            die('unknown phptype/dbsyntax in setConcatenationQueryOperator()');
    }
    return true;
}