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

R package teradatasql dbGetQuery taking forever to return somewhat larger data whereas python works very quickly

I have a database table from which I am trying to get 5+ million rows of two columns. The following piece of code in python works perfectly and quickly (In about 3 minutes for the full 5+ rows of data, retrieved via query and written to CSV): import…
Gopala
  • 10,363
  • 7
  • 45
  • 77
3
votes
1 answer

Download DML and DDL sql from Teradata using python

What approach should I follow to download DDL, DML and Stored Procedures from the teradata database using python. I have created the sample code but what is the approach to download these sql files for data migration process. udaExec =…
starlord
  • 135
  • 9
2
votes
2 answers

Why does WHERE clause removes null values from the result?

I have a table I want to filter data from. I tried the following query SELECT SIS, COUNT(*) FROM DL_SQ_DEV_INT.SMRY_DAILY_TRAILER_REPORT GROUP BY 1; Result: BL,17386 EQ,3242 FIFO,5747 GR,15655 HOLD,13035 LT BL,20566 LT GR,14615 LT OR,14190 LT…
Jonathan Lam
  • 1,237
  • 3
  • 20
  • 49
2
votes
2 answers

Select rowst where ID is on list and meet 2 other requirement, probably subquery in Teradata SQL?

I have table in Teradata SQL like below: ID | col1 | col2 ------------------- 111 | A | 54 222 | B | 8 333 | C | 17 444 | B | 44 555 | A | 1 And I have list of ID of clients: myList = ['111', '222', '333'] And I need to select ID of…
dingaro
  • 2,156
  • 9
  • 29
2
votes
0 answers

Do a SHA256 of a query field in Teradata

As part of a project I need to retrieve personal user information from a Teradata table. To preserve user privacy we need to have access only on the sha256 hash of the values. Would it be possible in Teradata to hash the value directly in the…
malavock
  • 341
  • 1
  • 5
  • 21
2
votes
2 answers

Find float column max scale and precision

I have a column with datatype float in Teradata. I want to find the Maximum precision and scale for that column. Note: My column's scale part has more than 10 digits in most of the places. Sample…
1
vote
0 answers

Loading Large Data From Teradatasql to Databricks

I am currently trying to load a large amount of data into a Databricks notebook using Teradata SQL. I was wondering if there is anything I can do to load the data into the notebook faster. regressors_query = '''SELECT * FROM…
az_peer
  • 11
  • 1
1
vote
0 answers

Resetting minimum value after certain condition is met

In Teradata, I want to add a date column that gives me the minimum date which would reset after a certain condition is met. In this case the min date is reset when the difference >= 60. Code initial table CREATE VOLATILE TABLE tbl_testing (id…
biguzs
  • 21
  • 4
1
vote
1 answer

How do we get the datatype and precision of columns in Teradata using query?

I want this as a query. I tried using a query but that is not giving me proper results. I want to get the datatype of the corresponding columns in Teradata with column name. I tried with dbc.columntype and column length but I'm getting null/? as a…
Anshu Sam
  • 11
  • 3
1
vote
1 answer

Teradata Maximum process end time capture for multiple processes

I am trying to fetch data for one asset for reporting purposes which is dependent on multiple processes and start time should be the earliest job that starts among them and end time should be latest completion time for one of those assets. I…
Debasis
  • 21
  • 3
1
vote
0 answers

Conditional join in teradata sql

I need to make a join between two tables. I need to count employees in each diversity group - it might be women, it might be POC etc. If it is women, I need to join on gender, if it's another group, i need to join on the group name. TableA is a cte,…
osfor
  • 17
  • 4
1
vote
1 answer

Batch unload using teradatasql python module

I have installed teradatasql python module recently. When I am doing batch select into table it is not providing all outputs. How to select multiple records at a time? with teradatasql.connect…
1
vote
0 answers

Hashing a column in Teradata

I need to hash a column in Teradata. I have the follwing code in SAS and i would like the output to be equal: COLUMN_HASH = upcase(put(sha256(strip(COLUMN)), hex64.)); But i cannot use SAS to insert the records to teradata, it would need to be done…
blidt
  • 119
  • 9
1
vote
1 answer

Restrict a Batch user access from SQL Assistant

Could you please guide me how to restrict a Batch user access only from SQL Assistant. I am using Teradata Version 17. Thanks in advance. Regards, Umair Restrict a Batch user access only from SQL Assistant
jay jo
  • 11
  • 2
1
vote
2 answers

Find if data in column fulfills a datatype condition in sql

I have a table product with a column product id which is string datatype as below. Product_id 101 102 102a I would like to know if there is any way to take all values in product_id which cannot fill the condition of integer which is 102a value as…
1
2 3
18 19