XSQL
is especially efficient for data processing. In fact, it can even be used as an
ETL tool, given the features it incorporates to facilitate transparent access to multiple databases.
1 DDL
1.1 Table
@ in Temporary Tables
Before creating a temporary table, we recommend users verify that it does not already exist in the database.
To avoid overlapping temporary tables, @
is the recommended prefix placed before table names.
This character is replaced, during execution time, by a suffix which guarantees the uniqueness of the table name.
Prefijo tmp_ en temporales
The prefix tmp_
is recommended for temporary tables in order to differentiate them from static tables.
1.2 Index
Creates an index in the specified table.
<index
name='name'
table='table'
columns='columns'
oracle='yes|no'
/>
Attributes | |||||
---|---|---|---|---|---|
Name | Type | Required | Default | Description | |
Aname | string | Index name. | |||
Atable | string | Table name. | |||
Acolumns | string | Names of the columns which comprise the index. | |||
Aoracle | string | yes | Indicates that the index should not be created if the RDBMS is Oracle. |
Example
Copy
<index name='@i_tmp_gadjudic1' table='@tmp_gadjudic' columns='codpri, fecha, cabres' />
1.3 Drop
This tag is used to remove tables from the database in which the statement is executed. It is composed of the following attributes:
<drop
table='table'
temp='y|n'
onexception='ignore'
/>
Attributes | |||||
---|---|---|---|---|---|
Name | Type | Required | Default | Description | |
Atable | string | Name of the table to be removed. | |||
Atemp | string | n | "y" or "yes" to indicate that the table is temporary. | ||
Aonexception | string | Allows any error in the table deletion to be ignored. |
Example
Copy
<drop table='galmacen' />
Example
Copy
<drop table='@tmpalt_alm' temp='y' onexception='ignore' /> <table name='@tmpalt_alm' temp='yes'> <column name='almalt' type='char' size='12' required='y' /> <column name='cuealt' type='char' size='4' required='y' /> <column name='priori' type='decimal' size='12' required='y' /> </table>
Example
Copy
<drop table='@tmp_display_aux' onexception='ignore'/> <select intotemp='@tmp_display_aux'> <columns> a.codart, a.varlog, a.coduni, a.numlot, a.codean, <p_fecini /> fecmov </columns> <from table='@tmp_display' alias='a' /> <where> a.fecmov BETWEEN <m_fecini /> AND <eval-date d='-1'><p_fecini /></eval-date> </where> </select>