Learn R Programming

SqlRender (version 1.19.1)

splitSql: Split a single SQL string into one or more SQL statements

Description

splitSql splits a string containing multiple SQL statements into a vector of SQL statements

Usage

splitSql(sql)

Value

A vector of strings, one for each SQL statement

Arguments

sql

The SQL string to split into separate statements

Details

This function is needed because some DBMSs (like ORACLE) do not accepts multiple SQL statements being sent as one execution.

Examples

Run this code
splitSql("SELECT * INTO a FROM b; USE x; DROP TABLE c;")

Run the code above in your browser using DataLab