Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

translateSqlFile

Translate a SQL file


Description

This function takes SQL and translates it to a different dialect.

Usage

translateSqlFile(
  sourceFile,
  targetFile,
  targetDialect,
  tempEmulationSchema = getOption("sqlRenderTempEmulationSchema"),
  oracleTempSchema = NULL
)

Arguments

sourceFile

The source SQL file

targetFile

The target SQL file

targetDialect

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

tempEmulationSchema

Some database platforms like Oracle and Impala do not truly support temp tables. To emulate temp tables, provide a schema with write privileges where temp tables can be created.

oracleTempSchema

DEPRECATED: use tempEmulationSchema instead.

Details

This function takes SQL and translates it to a different dialect.

Examples

## Not run: 
translateSqlFile("myRenderedStatement.sql",
                 "myTranslatedStatement.sql",
                 targetDialect = "postgresql")

## End(Not run)

SqlRender

Rendering Parameterized SQL and Translation to Dialects

v1.7.0
Apache License 2.0
Authors
Martijn Schuemie [aut, cre], Marc Suchard [aut]
Initial release
2021-03-01

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.