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

Is extract number with following text possible s

Need to extract number with 4 letters after from a string using sql teradata for example : Col1 ‘Ff10- 100 Mbps bhd’ ‘Jigd 300 Gbps’ ‘Gyfv 10 Mbps hhftf’ ‘Htfyy hhftf’ Should be resulting Output 100 Mbps 300 Gbps 10 Mbps 0 or same return back Thank…
Ghaida
  • 19
  • 1
0
votes
1 answer

Combing two tables using key value and filter

I have two tables, one from teradata and one from odbc, which I want to join into a new table using a key value along with a filtering in Python using Visual Studio Code. The two tables can be explained as follows: teradata The table from teradata…
idlatva
  • 29
  • 7
0
votes
0 answers

Regarding error from Strtok function :STRTOK: InputString or Delim length is 0; OR toknum parameter is no larger than 0

I have created logic to fetch data from string field: Input : dbname,tblname,comment,tablekind sample_1,table1,Test_SALES - SALES & PROD - Orders - flow - CORP - test_1@gmail.com - test_2@gmail.com,T sample_2,table2,Test_Finance - FS - PK -…
Sak
  • 61
  • 6
0
votes
0 answers

Teradata SQL - Foreign Key Reference No Check Option

The foreign key reference in the teradata with no check option behave differently for different statement. Select Count(*) or Select Count(1) Select * I want to understand what is happening and is there a document explanation to it or is it simply…
0
votes
0 answers

Teradata Labelling correct status involving multiple processes

I need help with determining correct STATUS of an asset, start & final refresh time correctly as one asset can be tagged to multiple processes having different status. START TIME: It should give minimum start time among the processes under that…
Debasis
  • 21
  • 3
0
votes
0 answers

Query to find average of rate per day per account

I have a requirement to find the average of a rate field. The average should be based know a date field, account number and product code. I need to use this query inside an insert..select statement. Insert into…
0
votes
0 answers

Error when using translate ((UNICODE_TO_KANJISJIS) for Tilde character in Teradata

I get the following error when I run the query: sel TRANSLATE(EMP_NAME USING UNICODE_TO_KANJISJIS) from TMP.EMP_NAME Error: The string contains an untranslatable character Looks like the tilde character cannot be translate to KANJISJIS. Is there a…
Jojo10478
  • 29
  • 6
0
votes
0 answers

Why won't my Teradata stored procedure execute properly with dynamic SQL?

I have a store procedure in teradata like following that I dont know why it does not work: Replace procedure dt.tablename (param1 varchar(100),param2 varchar(100)) Begin declare sqlstr varchar(500); set sqlstr= 'CREATE VOLATILE TABLE test1 AS…
ukiwuno
  • 1
  • 1
0
votes
2 answers

I would like to generate a list of dates with timestamp at an hourly interval using SQL in teradata

just want to know if there is a way that I can generate a list of dates for a certain date range (e.g.2023-01-01 to 2023-01-20) with timestamp at an hourly interval in Teradata using SQL Results that I want to derive (each date will have 24…
0
votes
0 answers

Teradata Update based on Fiscal Month End

We need to determine if employee is New Hire or not. (Flag 'Y' or 'N'). A fiscal month starts on 22nd of each month and end on 21st of next month. Can you please help with the logic? HireDateStart = AGENT_HIRE_DATE HireDateStop = AGENT_HIRE_DATE +…
Debasis
  • 21
  • 3
0
votes
1 answer

Getting syntax error in teradata sql query, missing keyword between var and 'NOT'

I'm trying out this query but I'm getting a syntax error, I'm not sure what the correct syntax would be so looking for some help here, the query is shown below: select rg.col_tar, count(distinct rg.col_tar) from ref_table1 rg full outer join…
fsssaiyan
  • 3
  • 2
0
votes
0 answers

Teradata String to Timestamp conversion based on CASE WHEN

I need help to convert string value to timestamp(6) based on case when condition as source values are not always in same format, mainly 2 formats available as mentioned in below examples: START_FNMOMENT_STR is varchar(100) and START_FNMOMENT is…
Debasis
  • 21
  • 3
0
votes
1 answer

Teradata SQL: How to create a new column that lists unique column values?

If I have the following table: PART_NO CUSTOMER QTY 1001 JII 2 1001 MTH 3 1002 JII 7 How can I write a query to return the…
0
votes
0 answers

CAST string to TIMESTAMP(0) in teradata

I have a string of timestamp as 27/Mar/2023:15:36:58 +0900 I want to cast it to timezone(0) preserving the timestamp info. I am trying to run following SQL but it fails saying Invalid Timestamp CAST('27/Mar/2023:15:36:58 +0900' AS TIMESTAMP(0) WITH…
curious_nustian
  • 596
  • 2
  • 7
  • 22
0
votes
0 answers

Teradata tpump: How to use 2 table under one label in single UPDATE statement so that performance is not impacted

For a particular Table update (which was missing current ts column), I used join to add another table(let say Table A) for certain keys to find the target row to update (in Table B). But it impacted the performance badly. The record commit came down…
Akmuhale
  • 1
  • 3