translateSqlFile: Translate a SQL file

View source: R/HelperFunctions.R

translateSqlFileR Documentation

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", "snowflake", "synapse", "spark", 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 documentation built on Oct. 7, 2023, 9:07 a.m.