commit_sql: Commit sql from file or character variable

Description Usage Arguments Value See Also Examples

View source: R/commit_sql.R

Description

Commit sql from file or character variable

Usage

1
commit_sql(conn, code, is_file = TRUE)

Arguments

conn

DBIConnection to sql server

code

Character of code or path to sql code

is_file

Logical variable indicates the code parameter refers to file name, defaults to TRUE

Value

List of data frames from all select statement, empty if no select statment

See Also

https://github.com/dajuntian/sqlTXT

Examples

1
2
3
4
5
6
7
## Not run: 
jcc <- RJDBC::JDBC("com.ibm.db2.jcc.DB2Driver", "C:/db2jcc4.jar")
conn <- RJDBC::dbConnect(jcc, "jdbc:db2://hostname:12345/dbname", "user", "pwd")
commit_sql(conn, "/home/user/bearhunt.sql")
commit_sql(conn, "select * from session.ca", is_file = F)

## End(Not run)

dajuntian/sqlTXT documentation built on May 17, 2019, 7:01 p.m.