tdFile: tdFile

Description Usage Arguments Details Value See Also Examples

Description

Submits a SQL file to Teradata to run. Can take a JDBC connection object (conn) if provided. If no JDBC connection is provided, then a connection is attempted using the user, and password provided. If none is provided, then tries to locate a connection object (conn) in the global environment.

If a connection profile (e.g. username, password, etc.) is provided, then an attempt is made to connect to Teradata. Once the query is run, the connection is then closed. If a connection object (conn) is provided to the function (or one is found globally), then the connection remains open.

Usage

1

Arguments

file

File to submit to Teradata.

...

Optional connection settings.

Details

Warning: This function reads in all lines and parses commands using ";". Thus, commands should be separated using that character. If a literal ";" is desired within the code, an escape character of "\" should precede it, e.g. where column="\;".

Value

An invisible object is returned indicating whether the file ran successfully.

See Also

tdConn for connection, tdHead for top observations, tdSpool for spool usage, and td for general queries

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## NOT RUN ##
## Connect to default data warehouse and data base
# tdFile("file.sql", <username>, <password>)

## Runs query using a separately established connection
# conn = tdConn(<username>, <password>)
# tdFile("file.sql", conn=conn)

## Uses same connection, but allows code to find globally
# tdFile("file.sql")

tranlm/tdR documentation built on May 31, 2019, 7:45 p.m.