Your Python script must import the teradatasql package in order to use the Teradata SQL Driver for Python. After importing the teradatasql package, your Python script calls the teradatasql.connect function to open a connection to the Teradata Database.
To verify a network connection
- Click Start and select Run. A Run dialog box appears.
- In the Open text box, type the PING command followed by the name of the Teradata Database and the COP1 suffix. For example: PING ssscop1.
These software are to be used to connect to your Teradata Advanced SQL (database) instance. Installation is simple using a Linux rpm installer. The size of the download file is ~70MB. To install, extract the zip tar file into a temporary folder and run the Linux rpm.
Teradata BTEQ stands for Basic Teradata Query. It is a command-driven utility that enables users to interact with one or more Teradata Database Systems. BTEQ utility is used in both batch and interactive mode. It can be used to run any DML statement, DDL statement, create Macros, and stored procedures.
To connect to Teradata, via the Teradata driver, use the information provided in Table 1-15 to complete the Connect to Database step of the JDBC/ODBC OTD Wizard. Note - The default server port is 6666 for the Type-3 driver Gateway. Login name of the account used to access the database.
To connect to Teradata through ODBC:
- Press the Windows key, start typing "ODBC", and select Set up ODBC data sources (32-bit) from the list of suggestions.
- Click the System DSN tab, and then click Add.
- Select Teradata Database ODBC Driver and click Finish.
- Click OK.
Open the SQL Assistant which is similar to Microsoft's SSMS from Windows > All Programs > Teradata SQL Assistant or from C:ProgramDataMicrosoftWindowsStart MenuProgramsTeradata Client 15.00Teradata SQL Assistant. Now you will be able to connect to the Teradata database and can query any tables.
Open Database Connectivity (ODBC) is an open standard Application Programming Interface (API) for accessing a database.
Teradata Studio Express is free and provides an information discovery tool that retrieves data from Aster, Teradata, and Hadoop database systems and allows the data to be manipulated and stored on the desktop.
Installation is easy and simple using a Windows installer. The size of the download zip file is ~200 MB. To install, extract the zip file into a temporary folder and run the setup.exe program. Teradata Wallet provides secure storage for private information, such as Teradata Database passwords, on client computers.
Connection Profile Using Teradata Studio
- Open Tedadata Studio Express.
- Create new Data Connection.
- Select Teradata Database, Enter Name and Press <Next>
- Enter Required information and Test connection.
- Database server name: TD-EXPRESS.
- User Name: dbc.
- Password: dbc.
To connect to a data source, from the main window of Teradata SQL Assistant select "Tools" and "Connect." Click the icon on the toolbar to select the data source and click "OK." In the dialog box, either select "Use Integrated Security," enter the Mechanism and Parameter, or enter the Username and Password.
Click Oracle SQL Developer Tools button and click Preferences.
- Click Database and Third Party JDBC Drivers.
- SQL Developer Connect to SQL Server and Teradata Database.
- Select Path to Add Entry of tdgssconfig and terajdbc4 for Teradata.
- Database: Third Party JDBC Drivers done.
- New Connection with SQL Server.
Following is a sample BTEQ script. . LOGON 192.168.1.102/dbc,dbc; DATABASE tduser; CREATE TABLE employee_bkup ( EmployeeNo INTEGER, FirstName CHAR(30), LastName CHAR(30), DepartmentNo SMALLINT, NetPay INTEGER ) Unique Primary Index(EmployeeNo); .
You can see the TDPID in Teradata service controller by clicking the Edit hosts option. The name you can see before cop1 or cop2 will be the TDPID of your system. Normally, for local systems TDPID will be "localtd".
Teradata SQL Assistant for Microsoft Windows User GuideSelect Tools > Execute. From the Query Window, right-click and select Execute.
When using BTEQ interactively, the user can log on by entering only a tdpid, which can be followed by a semicolon or a space. If BTEQ accepts the tdpid, it clears the input area and prompts for a userid: Userid: The userid can be followed by either a semicolon, a comma, or a space.
Collecting Teradata Data
- Install the module: Install-Module TeradataCmdlets.
- Connect to Teradata: $teradata = Connect-Teradata -User $User -Password $Password -Server $Server -Database $Database.
- Retrieve the data from a specific resource:
- Save a list of the column names from the returned data.
Following are the steps to execute your first BTEQ script.
- Open a txt file and save it as MyFirstBTEQ. txt in path where you have the Queryman installed.
- Write the following lines into the txt file. .logon password; DATABASE databasename; SELECT DATE;
- Open MS DOS prompt.
- Go to the path.