Executes the statements of creation of structure (DDL) over one or several databases. In the creation of the structure you can differentiate different objects to create.

  • Table: Just the creation of the table with its columns.
  • Index: Index, primary keys, foreign keys, etc.
  • Check: Checks.
  • Data upload: There are tables in which you want that when the table is created the system automatically loads records on this table.

1 connection.schema.model.create

<connection.schema.model.create
    type='type'
    dict='dict'
    pattern='pattern'
    debug='debug'
/>
Example

Executes the creation of tables in the database dbtest of the wic_icon dictionary.

Copy
<xsql-script name='model_create1'>
    <body>
        <println>
            <connection.schema.model.create type='table'  dict='wic_icon'  pattern='%' debug='false' />
        </println>
    </body>
</xsql-script>

To execute it from the console it should be written:

Copy
bin\ws-dbscript -dbms dbtest -file test.xml -user mlg

El xsql-script imprime el resultado.

Copy
|  782|dbtest  |dbsrv3|      |wic_icon|taptpres          |1/1  |SUCCEED|TABLE taptpres altered, operation is LOCK MODE ROW          
|  783|dbtest  |dbsrv3|      |wic_icon|tcalsaba          |1/1  |SUCCEED|TABLE tcalsaba created.                                     
|  784|dbtest  |dbsrv3|      |wic_icon|tcalsaba          |1/1  |SUCCEED|TABLE tcalsaba altered, operation is LOCK MODE ROW          
|  785|dbtest  |dbsrv3|      |wic_icon|tconcili          |1/1  |SUCCEED|TABLE tconcili created.                                     
|  786|dbtest  |dbsrv3|      |wic_icon|tconcili          |1/1  |SUCCEED|TABLE tconcili altered, operation is LOCK MODE ROW          
|  787|dbtest  |dbsrv3|      |wic_icon|tconcomu          |1/1  |SUCCEED|TABLE tconcomu created.

The system returns a vtable with the result. The columns of the vtable inform of the processed objects and their result.

Copy
Process sequencer
Database
Server
Dictionary
Table
Result
Statements