zinternal_update_db_info: Creates the db Environment and the SQL Connection (db$con)

Description Usage Arguments Examples

View source: R/update_db_info.R

Description

Creates the db Environment and the SQL Connection (db$con)

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
zinternal_update_db_info(
  Driver,
  Database,
  Server,
  UID,
  PWD,
  Trusted_Connection,
  Port = 1433,
  ...,
  ReadRelationshipsFromDB = TRUE,
  AddUserRelationships = TRUE,
  RegexToSelectTables = "^(DIM_|FACT_|TBL_)"
)

Arguments

Driver

A string. A SQL Driver, etc.: SQL Server;

Database

A string. The name of the SQL Database itself

Server

A string. A name that resolves into the SQL Machine, or the IP to the SQL Machine

UID

A string. The Username credential for the SQL Connection. NULL if Windows Login is to be used

PWD

A string. The Password credential for the SQL Connection. NULL if Windows Login is to be used

Trusted_Connection

A Boolean. TRUE or FALSE on whether Windows Login/Credentials are to be used, if a string is used it'll be passed as is.

Port

An Integer. The Port which the SQL Listener is listening at. Can be left blank whereupon it will default to 1433

...

If the relationships exist on the SQL Database, this can be left blank. Logical expressions for the SQL Relationships in the format: table1$FKcolumn2 == table2$IDcolumn1, table1$FKcolumn3 == table3$IDcolumn1, ...

ReadRelationshipsFromDB.

A Boolean. If TRUE an attempt to read the SQL Tables relationships from the Database will occur. User-defined relationships can also be added afterwards

AddUserRelationships.

A Boolean. If TRUE User-defined relationships declared on the ... parameter will be added to the local SCHEMA. To ignore online relationships and only add user-defined, set ReadRelationshipsFromDB to FALSE

RegexToSelectTables.

A String. It defaults to getting all SQL Tables whose name begins with DIM_, FACT_, or TBL_.

Examples

1
2
3
4
zinternal_update_db_info(Driver = "{SQL Server};", Database = "Chronogramme", Server = '123.456.7.8', UID = NULL, PWD = NULL, Trusted_Connection = TRUE, Port = 1433,
               DIM_Employee$Employee_MainSiteMainObjekt_SiteID == DIM_Site$Site_SiteID,
               DIM_Site$Site_RegionID == DIM_Region$Region_ID
               )

N1h1l1sT/dbautojoinr documentation built on Jan. 24, 2021, 10:15 a.m.