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
1 answer

Select the IDs in given series in Teradata SQL

How to select the ids following the series, for example, for every id, when condition 1 is 11,12,13 and corresponding condition 2 is null, 14, 16. The data is as follows id condition1 condition2 101 11 ? 101 13 …
0
votes
1 answer

TeraData equivalence for limit offset SQL - PAGED

In MySQL and other engines I use a statement of the type: SELECT reference FROM table WHERE field = 'iphone' ORDER BY reference LIMIT 2 OFFSET 0; But in TeraData I can't find an equivalency to perform a paginated query. I appreciate your ideas ;)
David AJ
  • 29
  • 1
  • 4
0
votes
2 answers

SQL query to pick the IDs according to below details

I need to determine the last event in the data when condition1 is 13 and condition2 is 14. However, it should not pick those IDs which have already passed through condition1 as 15 and condition2 as 16 and then again the last event is 13 and 14. i.e,…
0
votes
0 answers

How to change time zone setting inside create view code

Do you know if there is a way to write "set time zone interval '00:00' hour to minute" inside create view code? I`ve been finding ways on how to do it because I cannot change the default time zone setting of a user or ask him to change the current…
Jojo10478
  • 29
  • 6
0
votes
1 answer

How to show the latest record for "each" month given only a date range of each records

I have a history table that contains the records of each customer with start_date and end_date columns that indicate validity period of each rows. The table looks like this: | ID | Name | Code |start_date (Timestamp) |end_date (Timestamp) | |:---…
Jojo10478
  • 29
  • 6
0
votes
1 answer

how to write datetime <= (minus some days) in teradata case statement

I have to write an sql query where I need to extract data for 30 days minus few days, something like this, datetime <= -5 days what is the best possible way I can write in teradata? Thanks in advance:)
0
votes
0 answers

Teradata RegExp_Split_To_Table Error on TD

Not the nest at coding with t as ( select MHKAPPEALSINTERNALID as id, Cast(Note as VARCHAR(100)) as Note, UPDATEDAT, Cast(MHK_TYPE as VARCHAR(100)) as MHK_TYPE from vcoreMEDHOK_MHK_Notes Where cast(UPDATEDAT as Date)…
Tekno Joe
  • 21
  • 1
  • 6
0
votes
1 answer

VBA call a SQL query from Teradata encounter 3535 error message while this SQL statement runs well in Teradata

The VB for application version is 7.1; Teradata version 16.20.53.27. The SQL statement is very long, the length of it is 59972.I run it into Teradata directly, it works well. I use the following to execute this SQL in VBA: set connection =…
fred wu
  • 55
  • 6
0
votes
1 answer

dbc.columns in Teradata vs INFORMATION_SCHEMA.COLUMNS in BigQuery

Can someone suggest, How to find object names with help of column name in BigQuery? In Teradata, we can get objects(in all databases) in which particular column used by using dbc.columnsv. We can use dataset.INFORMATION_SCHEMA.COLUMNS in BigQuery to…
0
votes
1 answer

teradata: JSON_TABLE to shred array of numbers

On the Teradata database (ver.17), I would like to shred a JSON object as below: { "products": [{"category":"car", "name":"toyota"}, {"category":"aircraft", "name":"boeing"}, {"category":"fruit","name":"pear"}], …
Kota Mori
  • 6,510
  • 1
  • 21
  • 25
0
votes
1 answer

How to select clients which made minimum 2 transactions during last 30 days from current date in Terada SQL?

I have table in Teradata SQL about transactions like below: ID | NAME | DATE ------------ 123 | Adam | 10-09-2021 123 | Adam | 11-09-2021 333 | Jane | 15-06-2021 456 | Tom | 11-02-2016 123 | Adam | 08-09-2021 333 | Jane | 22-01-2021 123 |…
dingaro
  • 2,156
  • 9
  • 29
0
votes
1 answer

How do I resolve a connection pool handle = 1 error when using teradatasql in python?

I am attempting to execute some basic SQL via Python using the teradatasql module. The code appears to run and the SQL is executed: however, the execution of the Python itself ends with an error on the end of the code reproduced below. Currently, I…
dapperAF
  • 19
  • 4
0
votes
1 answer

Achieve incremental values for a month based on value in another column and date

I’m having a scenario where I have to increment the numbers in a month. Condition 1 : If the value in col2 is greater than 0 then expected output is 0. Condition 2: If value in col1 is 0 then expected output should be 999. Condition 3: If the value…
0
votes
2 answers

How to show the last record of each customer for each month?

Please help, I have a table that contains the history of changes of the customer`s record for the last 3 years. And I need to output the status or record of each customer for the "last day" of "each" month. The table looks like this: Table A: | ID …
Jojo10478
  • 29
  • 6
0
votes
1 answer

Can I use union all statement with insert into statement in teradata?

I have two tables with same number of columns and same data types. I want to union then with "union all" statement and want to insert the resultant values into another table. I am using this query INSERT into DB.HRfinal select…