On this Page
Table of Contents | ||||
---|---|---|---|---|
|
Snap type: | Write | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Description: | This Snap outputs a list of tables in a database. The Snap will connect to the database, read its metadata, and output a document for each table found in the database. The table names are output in a topological order so that tables with the fewest dependencies are output first. In other words, if table A has a foreign key reference to table B, then table B will be output before A. The ordering is intended to ease the process of replicating a group of tables from one database to another. Expected input: [None] Expected output: Documents with the following fields: Replicating a Subset of TablesThe output of the Table List Snap can be directly used to replicate an entire database. However, if you are only interested in a subset of tables, you can use a Filter Snap to select the table names you are interested in as well as the tables that they reference. For example, given the following diamond-shaped table graph where A depends on B and C and they both depend on D:
The Table List will output the following documents:
The filter will then remove any extra tables that happen to be in the schema. | |||||||||||||
Prerequisites: | None | |||||||||||||
Support and limitations: | Ultra pipelines: Works in Ultra Pipelines.Spark mode: Not supported in /wiki/spaces/SD/pages/1437917 mode. | |||||||||||||
Account: | This Snap uses account references created on the Accounts page of SnapLogic Manager to handle access to this endpoint. See /wiki/spaces/DRWIP/pages/1439198 for information on setting up this type of account. | |||||||||||||
Views: |
| |||||||||||||
Settings | ||||||||||||||
Label | Required. The name for the Snap. You can modify this to be more specific, especially if you have more than one of the same Snap in your pipeline. | |||||||||||||
Schema Name | The database schema name. Selecting a schema filters the Table name list to show only those tables within the selected schema. The property is suggestible and will retrieve available database schemas during suggest values. Example: test Default value: [None] | |||||||||||||
Compute table graph | Computes the dependents among tables and returns each table with a list of tables it has foreign key references to. The ordering of outputted tables is from least dependent to most-dependent. Note that as turning on this option will significantly slow down the Snap, it should be left as off unless you need it. | |||||||||||||
|
|
Examples
Expand | ||
---|---|---|
| ||
In this example, we will use an Oracle Table List Snap to get a list of all tables in schema TECTONIC, and store the list as a local file:
The setting of Oracle Table List Snap is simple, just put down the schema name in which we want to do query: This is the output of the pipeline: |
Expand | ||
---|---|---|
| ||
This example will show the error handling of the Snap. We use the same pipeline as the one in example #1 and route error messages to error view:
We give a non-exist schema name to Oracle Table List Snap that will cause error, and the error message will be routed to the error view: Here is the error message that is routed to error view:
|
Downloads
Attachments | ||||||
---|---|---|---|---|---|---|
|
Insert excerpt | ||||||
---|---|---|---|---|---|---|
|