Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

On this Page

Table of Contents
maxLevel2
excludeOlder Versions|Additional Resources|Related Links|Related Information

Overview

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.

Upcoming

Multiexcerpt include macro
nameOracle JDBC Driver Upgrade
templateDataeJyLjgUAARUAuQ==
pageOracle Snap Pack
addpanelfalse

Snap type:

Write


Snap Input/Output:

Expected input: [None]

Expected output: Documents with the following fields:
name - The fully-qualified name of the table. To use the table name in another Snap, like a Select or Insert, you can pass it through a ForEach Snap to another pipeline with the Select or Insert.
type - The type of table. This value is currently fixed to the string "TABLE".
dependents - (If Compute table graph is selected) A list of table names that have references to this table, including this table.

Replicating a Subset of Tables

The 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:

Code Block
       A
      / \
     B   C
      \ /
       D
    

The Table List will output the following documents:

Code Block
name=D; dependents=[A, B, C, D]
name=C; dependents=[A, C]
name=B; dependents=[A, B]
name=A; dependents=[A]


So, if you wanted to copy just table 'A' and its dependencies, you can add a Filter Snap with the following expression:

Code Block
 $.dependents.indexOf('A') != -1

The filter will then remove any extra tables that happen to be in the schema.

Prerequisites:

None

Support and limitationsfor Ultra pipelines:Works in Ultra Task Pipelines.
Account: 

This Snap uses account references created on the Accounts page of SnapLogic Manager to handle access to this endpoint.  See Oracle Account for information on setting up this type of account.


Views:


Input

This Snap has at most one input views.

OutputThis Snap has at most one output view.
Error

This Snap has at most one error view and produces zero or more documents in the view.


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 Specify the database schema name. Selecting a schema, filters the the Table name  list 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]schema. The suggestions in the Schema field are populated only when at least a single table exists in the schema. If no tables exist to use that schema, only SYS, SYSTEM, and XDB are populated.

Default value: None
Example: SYS


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.
Default value: Not Selected


Snap Execution


Select one of the following three modes in which the Snap executes:

  • Validate & Execute: Performs limited execution of the Snap, and generates a data preview during Pipeline validation. Subsequently, performs full execution of the Snap (unlimited records) during Pipeline runtime.

  • Execute only: Performs full execution of the Snap during Pipeline execution without generating preview data.

  • Disabled: Disables the Snap and all Snaps that are downstream from it.

Default ValueExecute only


Example: Validate & Execute



Examples



Expand
title1. Get a list of all the tables

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
title2. Error handling of the Snap

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

Multiexcerpt include macro
namedownload_instructions
pageOpenAPI

Attachments
patterns*.slp, *.zip


Insert excerpt
Oracle Snap Pack
Oracle Snap Pack
nopaneltrue