translateSingleStatement: Translates a single SQL statement from one dialect to another

Description Usage Arguments Details Value Examples

Description

translateSingleStatement translates a single SQL statement from one dialect to another.

Usage

1
2
translateSingleStatement(sql = "", targetDialect,
  oracleTempSchema = NULL)

Arguments

sql

The SQL to be translated

targetDialect

The target dialect. Currently "oracle", "postgresql", "pdw", "impala", "netezza", "bigquery", and "redshift" are supported

oracleTempSchema

A schema that can be used to create temp tables in when using Oracle or Impala.

Details

This function takes SQL in one dialect and translates it into another. It uses simple pattern replacement, so its functionality is limited. This removes any trailing semicolon as required by Oracle when sending through JDBC. An error is thrown if more than one statement is encountered in the SQL.

Value

A character vector with the translated SQL.

Examples

1
translateSingleStatement("USE my_schema;", targetDialect = "oracle")

kganilkg131/SQLCon documentation built on May 23, 2019, 12:51 a.m.