Phalcon\Db\Dialect\Oracle::dropTable PHP Method

dropTable() public method

Generates SQL to drop a table.
public dropTable ( string $tableName, string $schemaName, boolean $ifExists = true ) : string
$tableName string
$schemaName string
$ifExists boolean
return string
    public function dropTable($tableName, $schemaName, $ifExists = true)
    {
        $this->_escapeChar = '';
        $table = $this->prepareTable($tableName, $schemaName);
        $sql = sprintf('DROP TABLE %s', $table);
        if ($ifExists) {
            $sql = sprintf("BEGIN EXECUTE IMMEDIATE '%s'; EXCEPTION WHEN OTHERS THEN IF SQLCODE != -942 THEN RAISE; END IF; END", $sql);
        }
        $this->_escapeChar = "'";
        return $sql;
    }