Allows to create a new table in the database.
1 table
<table
name='tableName'
temp='y'
>
<column
name='name'
type='type'
size='size'
/> +
</table>
Attributes | |||||
---|---|---|---|---|---|
Name | Type | Required | Default | Description | |
Aname | string | Name of the table. | |||
Atemp | string | Indicate if the created table will be temporary or not, by default it will not be temporary. |
Arguments | |||||
---|---|---|---|---|---|
Name | Type | Required | Unique | Nullable | Description |
Ecolumn | string | Definition of columns. | |||
Aname | string | Name of the column. | |||
Atype | string | Data types of the column. | |||
Asize | string | Size of the columns. |
Returns | |
---|---|
Type | Description |
string | Returns the sql executed in the database server. |
Example
Create a table.
Copy
<xsql-script name='table_sample'> <body> <table name='users_test'> <column name='dni' type='serial' required='y' /> <column name='name' type='char' size='20' required='y' /> <column name='surnames' type='char' size='30' required='y' /> <column name='address' type='char' size='35' required='y' /> <column name='age' type='integer' required='y' /> </table> </body> </xsql-script>
Example
Create a temporary table.
Copy
<xsql-script name='table_sample_temp'> <body> <table name='@tmp_users_test_temp' temp='yes'> <column name='dni' type='serial' required='y'/> <column name='name' type='char' size='20' required='y'/> <column name='surnames' type='char' size='30' required='y'/> <column name='address' type='char' size='35' required='y'/> <column name='age' type='integer' required='y'/> </table> </body> </xsql-script>