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

tableExists() public method

echo $dialect->tableExists('posts', 'blog'); echo $dialect->tableExists('posts');
public tableExists ( string $tableName, string $schemaName = null ) : string
$tableName string
$schemaName string
return string
    public function tableExists($tableName, $schemaName = null)
    {
        $tableName = $this->escape(Text::upper($tableName));
        $baseQuery = sprintf("SELECT CASE WHEN COUNT(*) > 0 THEN 1 ELSE 0 END RET FROM ALL_TABLES WHERE TABLE_NAME = %s", $tableName);
        if (!empty($schemaName)) {
            $schemaName = $this->escapeSchema($schemaName);
            return sprintf("%s AND OWNER = %s", $baseQuery, Text::upper($schemaName));
        }
        return $baseQuery;
    }