This tag is used to created a new table. The columns can be indicated or you can use a schema defined in some of the
dictionaries of the connection database. Also, you can indicate if the temporary table in which case, differents actions are
performed depending of the database agent to which is connected. The following table, resumes the programation option and the
actions which the system performs internally:
1 table
<table
name='name'
temp='true|false'
/>
Attributes | |||||
---|---|---|---|---|---|
Name | Type | Required | Default | Description | |
Aname | string | Name of the table. You can indicated that the name will be generated, preceding the name with the symbol @. | |||
Atemp | boolean | Indicates if the table is temporary. |
Option 1 | Creation of a table indicating the columns. | |
The system converts the XML grammar to the adequate sentence for the database server and executes it, creating the table. | ||
Opction 2 | Creation of a table without indicate the columns. | |
The system converts the XML grammar to the adequate sentence for the database server and executes it, creating a table. | ||
Option 3 | Indicates if the table is temporary. You can indicate if the table to create is temporary (attribute temp='yes'). It is useful for both explicit and implicit tables (of catalogue). | |
The system converts the XML grammar to the adequate sentence for the database server and executes it, creating thus the table. |
Example
Creation of a explicit temporary table, named automatically by the server. Then, transactional operations are performed in the table.
Copy
<xsql-script name='table_sample1'> <body> <!-- The system is responsible of remove the table if exists --> <!-- or in the case of Oracle, performs TRUNCATE (removing thus --> <!-- the registers for the session). --> <table name='@TMP_APTEID' temp='yes'> <column name='apteid' type='integer' required='y' /> </table> <set name='m_empcode'>01</set> <set name='m_loteid'>01</set> <!-- Inserts information for the generated resting seatings. --> <insert table='@TMP_APTEID'> <select> <columns>apteid</columns> <from table='capuntes' alias='s' /> <where> s.empcode = '<m_empcode />' </where> </select> </insert> <!-- You can use the table @TMP_APTEID to obtain the identifiers. --> <update table='captpool'> <column name='loteid'><m_loteid /></column> <where> apteid IN (SELECT s.apteid FROM @TMP_APTEID s) </where> </update> </body> </xsql-script>
Example
Creation of a temporary implicit table, catalogued in some dictionary of the execution database. Then, transactional operations are performed in the table.
Copy
<xsql-script name='table_sample2'> <body> <!-- The system is responsible of remove the table if exists or in the case of Oracle, performs TRUNCATE (removing thus --> <!-- the registers for the session). Obtains the table of the dictionary and creates it in the execution database. --> <table name='tmp_aux_apteid' /> <set name='m_empcode'>01</set> <set name='m_loteid'>01</set> <!-- Inserts information of the generated resting seatings. --> <insert table='tmp_aux_apteid'> <select> <columns>apteid</columns> <from table='capuntes' alias='s' /> <where> s.empcode = <m_empcode /> </where> </select> </insert> <!-- The table is use tmp_aux_apteid para obtener los identificadores. --> <update table='captpool'> <column name='loteid'><m_loteid /></column> <where> apteid IN (SELECT s.apteid FROM tmp_aux_apteid s) </where> </update> </body> </xsql-script>