< BOOLEAN: Column Types & Output   (Previous) Table of Contents (Next)   BOOLEAN: Getting Column Type >

BOOLEAN: Setting Column Type

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