SQL Insert
Insert rows into a database table
Processing
For every input row, the step inserts a record into a database table.
Settings
Name | Type | Description |
---|---|---|
Connection |
dict |
The database connection to use. Evaluated for each input row |
Schema |
string |
The database schema of the table. Evaluated for each input row |
Table |
string |
The database table to insert into. Evaluated for each input row |
Batch Size |
long |
Number of records sent to the database in a batch.
Evaluated for each output table |
Commit Size |
long |
Number of records after which data is committed.
Evaluated for each output table |
Primary Key |
string |
The name of the primary key field in the database table. If you wish to retrieve the generated primary key, some databases - Oracle for example - require that you specify the field name explicitly. Evaluated for each output table |
Get Generated Key |
boolean |
If enabled, attempt to get the generated key for each inserted row. The key is avilable as Evaluated for each output table |
Columns |
How table columns are established:
Specified at design time |
Table Columns - fixed
Defines data written to the database table.
Evaluated for each input row
- Type
- Data type of the field. Field values are implicitly cast to this type.
- Name
- Name of the table field to write to.
- Value
- The value to write.
Table Columns - data driven
When output columns are data driven, the step determines inserted fields at runtime.
Name | Type | Description |
---|---|---|
Table Columns |
list |
A list defining the columns written to the table. Each entry in the list is a dict with the following keys:
To specify three output columns you would supply a definition such as:
Evaluated for each output table |
Column Values |
list or dict |
A list or dict defining the data to write to the table. If the data structure is a list, the value for each column is extracted in order. If the data structure is a dict, the values for columns are extracted by using column names as keys. For example, consider the following column definition:
We can supply column values as a list:
We can also supply column values as a dict:
Evaluated for each input row |
Results
Name | Type | Description |
---|---|---|
generated_key |
long | Auto-generated key for currently inserted record. |