translateSql: translateSql

Description Usage Arguments Details Value Examples

View source: R/RenderSql.R

Description

translateSql translates SQL from one dialect to another

Usage

1
2
translateSql(sql = "", targetDialect, oracleTempSchema = NULL,
  sourceDialect)

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.

sourceDialect

Deprecated: The source dialect. Currently, only "sql server" for Microsoft SQL Server is supported

Details

This function takes SQL in one dialect and translates it into another. It uses simple pattern replacement, so its functionality is limited.

Value

A list containing the following elements:

originalSql

The original parameterized SQL code

sql

The translated SQL

Examples

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

SqlRender documentation built on Aug. 17, 2018, 9:05 a.m.