> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-mintlify-fbfa8bee.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> Le moteur `Dictionary` affiche les données du [dictionnaire](/reference/statements/create/dictionary) comme une table ClickHouse.

# Moteur de table Dictionary

Le moteur `Dictionary` affiche les données du [dictionnaire](/fr/reference/statements/create/dictionary) comme une table ClickHouse.

<div id="example">
  ## Exemple
</div>

Prenons l’exemple d’un dictionnaire `products` avec la configuration suivante :

```xml theme={null}
<dictionaries>
    <dictionary>
        <name>products</name>
        <source>
            <odbc>
                <table>products</table>
                <connection_string>DSN=some-db-server</connection_string>
            </odbc>
        </source>
        <lifetime>
            <min>300</min>
            <max>360</max>
        </lifetime>
        <layout>
            <flat/>
        </layout>
        <structure>
            <id>
                <name>product_id</name>
            </id>
            <attribute>
                <name>title</name>
                <type>String</type>
                <null_value></null_value>
            </attribute>
        </structure>
    </dictionary>
</dictionaries>
```

Interrogez les données du dictionnaire :

```sql theme={null}
SELECT
    name,
    type,
    key,
    attribute.names,
    attribute.types,
    bytes_allocated,
    element_count,
    source
FROM system.dictionaries
WHERE name = 'products'
```

```text theme={null}
┌─name─────┬─type─┬─key────┬─attribute.names─┬─attribute.types─┬─bytes_allocated─┬─element_count─┬─source──────────┐
│ products │ Flat │ UInt64 │ ['title']       │ ['String']      │        23065376 │        175032 │ ODBC: .products │
└──────────┴──────┴────────┴─────────────────┴─────────────────┴─────────────────┴───────────────┴─────────────────┘
```

Vous pouvez utiliser les fonctions [dictGet\*](/fr/reference/functions/regular-functions/ext-dict-functions) pour obtenir les données du dictionnaire dans ce format.

Cette vue n'est toutefois pas utile si vous devez obtenir des données brutes ou effectuer une opération de `JOIN`. Dans ce cas, vous pouvez utiliser le moteur `Dictionary`, qui affiche les données du dictionnaire dans une table.

Syntaxe :

```sql theme={null}
CREATE TABLE %table_name% (%fields%) engine = Dictionary(%dictionary_name%)`
```

Exemple d’utilisation :

```sql theme={null}
CREATE TABLE products (product_id UInt64, title String) ENGINE = Dictionary(products);
```

D’accord

Regardez ce que contient la table.

```sql theme={null}
SELECT * FROM products LIMIT 1;
```

```text theme={null}
┌────product_id─┬─title───────────┐
│        152689 │ Some item       │
└───────────────┴─────────────────┘
```

**Voir aussi**

* [Fonction de table dictionary](/fr/reference/functions/table-functions/dictionary)
