The INSERT statement is used to insert one or more rows into a table or view.
1 Insert
<insert
table='table'
columns='columns'
prefix='prefix'
>
<column
name='name'
value='value'
/> *
<select /> ?
</insert>
Attributes | |||||
---|---|---|---|---|---|
Name | Type | Required | Default | Description | |
Atable | string | Table name | |||
Acolumns | string | Column names is used in case of insert type statements from a select. | |||
Aprefix | string | Name of the prefix of the variables that contain the data to be inserted. |
Arguments | |||||
---|---|---|---|---|---|
Name | Type | Required | Unique | Nullable | Description |
Ecolumn | Column name and assigned value. | ||||
Aname | Column name | ||||
Avalue | Value to be inserted in the column. | ||||
Eselect | SELECT with the data you want to insert. |
Example
Example of insertion by columns:
Copy
<insert table='cdataemp'> <column name='ctafrm'>####.#####</column> <column name='tipdir'>0</column> <column name='ctaaux'>0</column> </insert>
Example
Insert-select insert example
Copy
<insert table='tabla_destino'> <select> <columns> tabla_origen.columna1, tabla_origen.columna2, tabla_origen.columna3, tabla_origen.columna4 </columns> <from table='tabla_origen'/> <where> tabla_origen.columna1 = 'A' </where> </select> </insert>
Example
Example of insertion by variable prefix
Copy
<insert table='cdataemp' prefix='m_' />