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

Teradata logs. Statistic/Partitioning usage

May be someone knows is it possible to find in Teradata logs what statistics or even better what partition ranges was used in particular query? For example in table definition we have date range: PARTITION BY ( Range_N(TransactionDate BETWEEN DATE…
andreya
  • 1
  • 2
0
votes
0 answers

Teradata - Parsing data using strtok function - identify bad data

I need help in identifying bad data(PERSON_NAME) from below select query due to which query is failing as it is not able to parse FIRST_NAME & LAST_NAME. SELECT PERSON_NAME ,Trim(OReplace(PERSON_NAME,StrTok(PERSON_NAME,'…
0
votes
0 answers

Teradata Least function giving unexpected result when used with negative input

I am trying convert an age in days into age buckets such that there are 365 days in each 12 buckets (11 x 30) + 35. To get around the uneven number of days in the age buckets I am using the FLOOR function to extract the full years and the CEILING &…
johnb25
  • 18
  • 2
0
votes
2 answers

Min function in Teradata unlike Python

I am doing sort of a code migration from Python to Teradata: The python code is this: max = min(datetime.today(), date + timedelta(days=90)) where date variable holds a date. However, in Teradata, I know this min function won't work the same way.…
User771
  • 53
  • 5
0
votes
1 answer

Updating column value to replace a particular character in Teradata

I need help with replacing column value to replace all '%' delimiter with '~'. Example:…
0
votes
0 answers

How to list tables with suffix of dates?

I need to fetch below kind of tables from DBC.tablesv. Adom_test_20221114 Domtest_test_20221013 Etc........ Looking for a best suggestion. I appreciate if you could share me the query instead of any docs/websites
0
votes
0 answers

Is there anyway that i could avoid spool errors like this

Scenarios where Spool error occurs in Teradata Does join clause can get the spool error I have implemented a query where there is a join similar to SELECT FROM Tabel_1 A JOIN Tabel_2 B ON A.column = B.column sample 10; and i also tried…
0
votes
1 answer

Teradata comparison between 2 variables inside BTEQ and choose an outcome

I need help to compare 2 variables inside Teradata BTEQ script and take a decision based on the outcome. I tried something like below: CREATE VOLATILE TABLE VT_JRNL_MAX_SNAPSHOT_DT,NO LOG,NO FALLBACK ( MAX_DATE_JRNL DATE FORMAT 'YYYY-MM-DD' ); …
0
votes
1 answer

TeraData REGEXP_SUBSTR date extraction from API Field

Community! I am trying to get this syntax to work and I need some assistance. I need to remove everything in the API field and just get the date in the column. I am struggling to accomplish this and not sure how to write this. Any rewrites would be…
CodeOfArms
  • 21
  • 4
0
votes
1 answer

How do I pull row values based on category into separate columns in teradata sql?

I tried doing aggregation but it still results in multiple rows for each id. I would like to write a query to get data as in result table (2nd) from the source table (1). AmtCategory 1->AmtPaid, 2-AmtReturned, 3->Fees
0
votes
0 answers

Teradatasql teradata_write_csv file encoding?

I am using the Teradatasql library to download data into a CSV file, using: sql="{fn teradata_write_csv("+destination_path+")}SELECT DISTINCT..." How do I determine (or specify) what the file encoding is? Is there a default encoding, or does it use…
Wige
  • 3,788
  • 8
  • 37
  • 58
0
votes
0 answers

sql sum function parameters on teradataml dataframe

I have a teradataml dataframe, and I have the following code : tdml_df = tdml_df.assign(stock=func.sum(tdml_df.flow.expression) .over(partition_by=tdml_df.NUM_CTR.expression, …
martsa17
  • 1
  • 1
0
votes
0 answers

Using INSERT Operator along with DDL Operator in TPT

I am trying to insert data from HDFS into a teradata table using TPT. I have read the documentation and tried to use DDL Operator to insert but I am unable to figure out a way to use INSERT OPERATOR along with DDL OPERATOR. Here is my attempt to do…
shri
  • 37
  • 5
0
votes
1 answer

Save result of Teradata SQL statement

Does anyone know how I can save the output of the “HELP VOLATILE TABLE” statement as a table that I can use in a query later on. My goal is to save a list of all Volatile Tables that are currently present. I tried to use the “HELP VOLATILE TABLE” in…
Eren
  • 73
  • 1
  • 2
  • 8
0
votes
2 answers

How do I obtain the below mentioned scenario in TERADATA?

There is a column as DATE_OF_BIRTH of datatype varchar(10). The expected data format is YYYY/MM/DD. However there are some NULL values and some values only contain the year(YYYY) value alone. The output is to calculate the AGE with this data. If the…
Shivu
  • 11
  • 1