Questions tagged [teradatasql]

The Teradata SQL Driver for Python (or related drivers). For Teradata (Vantage) database questions, use the [teradata] tag instead.

The Teradata SQL Driver for Python is a DBAPI Driver that enables Python applications to connect to the Teradata Database. The Teradata SQL Driver for Python implements the PEP-249 Python Database API Specification 2.0.

It is available from PyPI or Teradata's public download site and is used by the Teradata Python Package (teradataml) and the Teradata SQL Driver Dialect for SQLAlchemy (teradatasqlalchemy) to connect to a Teradata DBMS, aka Teradata Vantage SQL Engine. This driver is also leveraged by the Vantage Modules for Jupyter and is closely related to the Teradata SQL Drivers for R and Node.js.

272 questions
0
votes
0 answers

Assigning Parent Number to Child Number in Teradata

I've been trying to assign parent case number to child case number using Teradata SQL. I have the table Patient Table PatientID Cal_Date FirstVisitCreateTs Location VisitNum VisitFlag Comments 1234 2021-09-22 2021-09-22…
GOU7HAM
  • 13
  • 4
0
votes
1 answer

List all the tables and row counts in Teradata SQL?

I would like to translate the following Oracle SQL query into Teradata SQL: SELECT table_name, num_rows FROM ALL_TABLES This query retrieves all the tables along with the number of rows. What is the Teradata SQL equivalent?
Joannes Vermorel
  • 8,976
  • 12
  • 64
  • 104
0
votes
1 answer

List all tables, columns and types in Teradata SQL?

I would like to translate the following Oracle SQL query into Teradata SQL: SELECT table_name, column_name, data_type FROM ALL_TAB_COLUMNS This query retrieves all the tables, columns and their types. What is the Teradata SQL equivalent?
Joannes Vermorel
  • 8,976
  • 12
  • 64
  • 104
0
votes
0 answers

Gateway error when connecting Python to Teradata

Can anyone share some information regarding the issue below? I have been able to connect to Teradata via Python using Teradata and Teradatasql libraries. I cannot connect using pyodbc and sqlalchemy. Python code: from sqlalchemy import…
timmyscj
  • 1
  • 1
0
votes
0 answers

How can I see all the views under a schema in Teradata?

Could you please help me figure out how I can find out what are all the views under a certain schema? At the moment I know only the names of 3 of them but there are more. What I…
dityo
  • 11
  • 4
0
votes
1 answer

ERROR: Datatype Mismatch in THEN/ELSE expression

Getting Error: "Datatype Mismatch in THEN/ELSE expression" from the below code: MAX(CASE WHEN CustRank = 1 THEN StopDt ELSE 0 END) AS StopDt1 Here StopDt is in MM/DD/YYYY format. Please help how to resolve the issue.
Sudha
  • 1
0
votes
1 answer

How to connect to Teradata database using Dask?

The pandas equivalent code for connecting to Teradata, I have used is: database = config.get('Teradata connection', 'database') host = config.get('Teradata connection', 'host') user = config.get('Teradata connection', 'user') pwd =…
krx
  • 85
  • 1
  • 7
0
votes
1 answer

Export 100 millions rows from teradata to snowflake using python

What is the approach to export hundreds of millions of rows from teradata to snowflake? I am using the approach of to_csv() however, it's taking more then 2 hrs to load the data from dataframe to csv. Any faster/better approach the can be used to…
starlord
  • 135
  • 9
0
votes
0 answers

Case Statement Datatype Mismatch in THEN/ELSE expression

This is in Teradata. I am trying to write a case statement that can work if the data comes in the following format: YYYY-MM-DD ex. 2021-12-17 MM/DD/YYYY ex. 12/17/2021 YYYYMMDD ex. 20211217 Excel Serial ex. 44547 Note: This is an Excel format that…
acC
  • 1
  • 1
0
votes
1 answer

Python module teradatasql throwing "Syntax error: expected something between the beginning of the request and the word"

I am trying to use teradatasql and the sample code given for FastExportTable is throwing error for me. Code: #!~/miniconda3/bin/python # This sample program demonstrates how to FastExport rows from a table. import teradatasql with…
300
  • 965
  • 1
  • 14
  • 53
0
votes
1 answer

Python teradatasql get column_name and data_type

I am using teradatasql to connect DB and get the table definition. Below is my code which returns the definition for table. Here I trying find any default function which returns the colum_name and data_type of table as a separate function. with…
user1591156
  • 1,945
  • 4
  • 18
  • 31
0
votes
1 answer

How to create Teradata trigger (after insert update)?

I am trying to eliminate null values without making the column "not null" to avoid errors. So, I wanted to create a trigger to update each inserted row if it contains null to replace it with 'N'. The following syntax results in "Executed as Single…
0
votes
0 answers

Query to determine column values shorter than normal

I have a column whose values are supposed to be 11 numbers, however, some of them have less than 11 numbers. How can I write a query that will return all the values in this column that have less than 11 numbers. I am working in Teradata
0
votes
1 answer

Match names from one table with names from other

I have a table CID FirstName LastName Loc 123 Brad Shaw ASD 234 Chad Reed SES 345 Bryan Miles WED 456 Mr Bradley Knight ASD 567 Doctor Chadwick Prince WED 678 Mrs Bryana Yang SES 789 Arty-stry Blue POR Another…
User56756
  • 352
  • 4
  • 19
0
votes
0 answers

I see row count difference in Teradata tables between export result and query count

Recently I've moved one Teradata test table data to bigquery and I see the row count difference between TD and BQ. As I checked further, I see one of the row value is in "DATE"format instead of "String" because that column is PI column and the data…