transformations:sqlcommand
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
transformations:sqlcommand [2016/06/19 18:44] – created dmitry | transformations:sqlcommand [2017/05/01 22:47] – dmitry | ||
---|---|---|---|
Line 1: | Line 1: | ||
===== SQL Command ===== | ===== SQL Command ===== | ||
- | Sends a free-form SQL query to a database, specified by a [[: | + | Performs one of these 4 commands: |
+ | * Create database table | ||
+ | * Delete database table | ||
+ | * Delete all rows | ||
+ | * Custom SQL query | ||
+ | |||
+ | ==== Create database table ==== | ||
+ | Creates a new database table. The table name can be specified either explicitly, or using a [[: | ||
+ | |||
+ | Field types are automatically suggested based on the input dataset, but can be changed manually. Field names are taken from the input dataset. They are case-sensitive. | ||
+ | |||
+ | ==== Delete database table ==== | ||
+ | Deletes a database table and all data in it. The table name can be specified either explicitly, or using a [[: | ||
+ | |||
+ | Be careful when deleting database tables as this operation can't be undone. All information in the target database table is lost forever. | ||
+ | |||
+ | ==== Delete all rows ==== | ||
+ | Makes a database table empty by removing all data (rows) from it. The table structure (i.e. field names and types) remains the same. The table name can be specified either explicitly, or using a [[: | ||
+ | |||
+ | Note that some databases don't have a native command for truncation. In such cases truncation is performed with the help of a DELETE query. The operation is atomic meaning that it either deletes everything, or, in case of a failure, nothing. | ||
+ | |||
+ | ==== Custom SQL query ==== | ||
+ | Sends a free-form SQL query to the database, specified by [[: | ||
The query can include [[: | The query can include [[: | ||
- | | + | |
The query can include multiple statements, if this is supported by the database connector. | The query can include multiple statements, if this is supported by the database connector. | ||
** Use cases ** | ** Use cases ** | ||
- | * Export data into a database by instructing the database to load a text file (e.g. previously generated by EasyMorph) | + | * Export data into a database by instructing the database to bulk load a text file (e.g. previously generated by EasyMorph) |
- | * Truncate/ | + | |
* Trigger stored procedures | * Trigger stored procedures | ||
** See also ** | ** See also ** | ||
- | * [[http:// | + | * [[http:// |
transformations/sqlcommand.txt · Last modified: 2022/12/05 14:23 by craigt