1 map

Axional Studio XSQL-Script allows to use tables of hashing. This ara data structures specially designed to implement dictionarys (searching, insertion and remove operations).

A hash table is a type of collection formed by pairs of keys and values which are stored inside of a table. The key is used to obtain the index of value location inside the table, used for this a function called dispersion function or hash. So, a hash structure is formed by three basic elements:

Table: where the elements are stored.

Dispersion function: given a key, provides the index of the table where the value associated is stored. It is possible that exist two differents keys for which the hash function produces the same index. This fact is called collision, and the two differents keys which produces the same index, they are called synonymous respect to the function of dispersion used.

Collision resolution function: determine what to do when the same index is obtained in the table for two different keys.

So, this structure allows to access associatively to the information, but also she does it in a constant average time. It means, that the time necessary to access to a value is not going to depend on the number of keys that the structure stores.

Axional Studio XSQL-Script disposes of the function <map> which possibilities the use of hash structures, providing a set of operations which allows its management.

Create a map (set of key couples - value).

    <expr /> ?
    <var /> ?
<xsql-script name='map_clear_sample1'>
        <map name='m_map'>

{0=ZERO, 1=ONE, 2=TWO, 3=THREE, 4=FOUR, 5=FIVE, 6=SIX, 7=SEVEN, 8=EIGHT, 9=NINE}