Generic JDBC - Execute

In this article

Overview

You can use this Snap to execute a SQL statement/query against a SQL database. This Snap also supports DCL commands (Grant and Revoke).

  • This Snap works only with single queries.

  • This Snap only supports conversion of standard JDBC specification 4.1 types listed here. Learn more about the JDBC 4.1 specification. If you want database-specific conversion, then a database specific Snap pack should be used. For example, for handling TIMESTAMPTZ and TIMESTAMPLTZ formats, you should use the Oracle Snap Pack.

  • The Generic JDBC Execute Snap is used for simple DDL (SELECT, INSERT, UPDATE, DELETE) type statements. This Snap also supports DML operations (CREATE, ALTER, INSERT, and SELECT) when using AWS Athena database.

Snap Type

The Generic JDBC - Execute Snap is a WRITE-type Snap that writes the results of the executed JDBC queries.

Prerequisites

None.

Support for Ultra Pipelines  

Works in Ultra Pipelines

Known Issues

  • If a SELECT query in the SQL statement field in the Snap Settings contains duplicate column names, then the query result displays the column name twice, with the latter prefixed with the table name. If the column name occurs more than twice, the second entry is still prefixed with the table name, but it displays the value of the column mentioned last in the query. The example below illustrates this behavior. 

Example

Consider the following query, where the column name "name" is repeated three times: 

select id, name, city, location, id as name, city as name, location as name from address

Expected output:

The Generic JDBC - Execute Snap's output should reflect the correct query result containing all the six fields, as shown in the image below:

Actual output:

The Snap's output displays the repeat occurrence of the column "name" only once, prefixed with the table name "address" as shown in the image below. Further, it holds the value of the table column "location", which was mentioned last in the SELECT query. 

To avoid this issue, we recommend that you give unique column names in the query.

  • The metadata output in the second output preview is not displayed in table format when your target database is AWS Athena.

  • The suggestions list is not populated for Table name field when your target database is AWS Athena.

  • When the SQL statement property is an expression, the Pipeline parameters are shown in the suggest, but not the input schema.

  • When the Generic JDBC—Execute Snap connects to the Sybase database to retrieve BigTime-type data, the Snap displays both date and time for the data type.

Snap Views

Type

Format

Number of Views

Examples of Upstream and Downstream Snaps

Description

Type

Format

Number of Views

Examples of Upstream and Downstream Snaps

Description

Input 

Document

  • Min: 0

  • Max: 1