hanaml.ConnectionContext.RdConnectionContext
hanaml.ConnectionContext( dsn = "", username = "", password = "", odbc = TRUE, jdbcDriver = NULL, rodbc = FALSE, encrypt = NULL, validateCertificate = NULL, autocommit = FALSE, ... )
| dsn |
|
|---|---|
| username |
|
| password |
|
| odbc |
|
| jdbcDriver |
|
| rodbc |
|
| encrypt |
|
| validateCertificate |
|
| autocommit |
|
| ... |
Object of R6Class with methods for ConnectionContext.
Represents a connection to a SAP HANA system. ConnectionContext includes methods for creating DataFrames from data on SAP HANA. DataFrames are tied to a ConnectionContext, and are unusable once their ConnectionContext is closed.
close()Closes the existing connection.
Usage:
conn$close()
sql(sql)Returns a DataFrame representing a query.
Usage:
df <- conn$sql("SELECT T.A, T2.B FROM T, T2 WHERE T.C=T2.C")
Arguments:
sql, character: Sql Query.
DataFrame
Dataframe for the query.GetCurrentSchema()Returns the name of current working schema in the database.
Usage: conn$GetCurrentSchema()
Returns:
character Current schema name.
hana.version(getMajor=FALSE, ...)Returns the version or major version of SAP HANA.
Usage: conn$hana.version()
Arguments:
getMajor, logical: if TRUE, return the major nubmer of SAP HANA version. Defaults to FALSE.
character or integertable(table, schema = NULL)Returns a DataFrame representing a table.
Usage:
df1 <- conn$table("MY_TABLE")
df2 <- conn$table("MY_OTHER_TABLE", schema="MY_SCHEMA")
Arguments:
table, character: Table Name(without schema).
schema, character, optional: Schema name.
Defaults to the ConnectionContext's current schema if not provided.
DataFrame
DataFrame selecting data from that table.