Questions tagged [teradatasql]

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.

84 questions
2
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
  • 9,554
  • 4
  • 38
  • 63
1
vote
2 answers

How to handle repeated records in SQL?

I have a simple data set like below: Employee Data I need minimum start date & max end date of an employee whenever there is a dept id change or status code change. So i wrote this formula for Min start date- select emp id, dept id, status code ,…
1
vote
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
2 answers

Subtracting value in one column from the date in another column

I have tried: add_months('date_column', -'number_of_months_column') I get: error [3535] A character string failed conversion to a numeric value. Is what I am trying to do possible with the add_months option?
1
vote
1 answer

Identify Temporal Table in Teradata Database

Is there a SQL query which can fetch the list of all Temporal Table from Teradata Database? Is there any special Column for Temporal Tables which identifies them of which type of Temporal Table it is?
1
vote
0 answers

CAST to TIMESTAMP field in Teradata

I have timestamp stored in VARCHAR field in the format Tue Jul 28 04:05:16 PDT 2020. Can I cast it to a timestamp(0) field in Teradata ?
pats4u
  • 103
  • 3
  • 12
1
vote
0 answers

Teradata stored procedure result output

How I can print var2? REPLACE PROCEDURE Name(out var2, in var1) ---some code goes here BEGIN TRANSACTION; SET var2= var1+ 5; end; REPLACE PROCEDURE Name(out var2, 5)
Bikash
  • 11
  • 1
0
votes
1 answer

Hierarchical comparison

I have the following two columns in a dataset with approximately 50 columns: One Two 1B 2A 3D 4C 3D 3D ... Values are from 1 to 5 (from highest to lowest) and from A to F (from highest to lowest). I would need to calculate how many…
Val
  • 299
  • 11
0
votes
2 answers

SQL Query to extract latest 2 dates from a column

A column consists of dates only. I need to extract the latest 2 dates from the table. What is the best way to do it? Example: Values in a table having date column as 01-01-2021, 01-02-2021, 01-03-2021 I would need 01-02-2021,01-03-2021 as my output.
0
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
  • 271
  • 5
  • 19
0
votes
1 answer

Make a case with several results SQL TERADATA

I am looking to make a case in a SQL query and assign according to the condition several results. For example : Code : INSERT INTO DESTINATION_TABLE (DT_TRT, NU_QUARTER, NU_YEAR) VALUES (SELECT CASE WHEN #P_DT_TRT# = '1900-00-00' THEN…
0
votes
0 answers

What's mean of "nos_usr to nos_usr" in tera data?

GRANT CREATE TABLE on nos_usr to nos_usr; GRANT EXECUTE FUNCTION on TD_SYSFNLIB.READ_NOS to nos_usr; above code, I can understand the meaning of "TD_SYSFNLIB.READ_NOS to nos_usr". It means give READ_NOS rights to nos_usr. BUT I don't understand the…
0
votes
0 answers

3706 syntax error in teradata expected something between ')' and the 'AS' keyword

I am getting the error message "3706 syntax error in teradata expected something between ')' and the 'AS' keyword" when try to run an update query in Teradata. There are red dotted lines on ") AS PRSCRBR_LAST_NM," on the second line of the query…
0
votes
0 answers

I have a table to find comma or pipeline present in the columns in teradata...any help would be appreciated.. please suggest generic query

Id Name address 123 mona #13,Jainroad|Mh Here i have to find commas and pipeline in address column Similarly i have to apply on different columns Select * from table Where col1 like '%,%';
0
votes
0 answers

While importing the data from .txt file into teradata table i am getting invalid timestamp error

I have a .txt file contains timestamp column like 9/1/2020 00:00:00.000000 and some other columns.but while importing into teradata SQL assistant getting invalid time stamp error. please help me the way as I need to import file data into volatile…
1
2 3 4 5 6