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

sqlalchemy.exc.NoSuchModuleError: Can't load plugin: sqlalchemy.dialects:teradatasql [10076] Failed to execute script pyinstalletest

i'm trying to create a exe which import some data into teradata.As a test script i'm trying to connect Teradata using below code. i can able to successfully connect in my local. from sqlalchemy import create_engine user = 'dbc' pasw=user host =…
0
votes
1 answer

Improving a SQL teradata query

I have a table like below and I want 'Y' in front of Ref 345 and 789 in the result-set on basis of count(Ref) = 1 where the amount is less than 0. I am using this query to get the desired output. My question is, is there any other (and more…
User771
  • 53
  • 5
0
votes
0 answers

Error uploading data into Teradata using Teradatasql module in python

I am trying to upload data into a table in Teradata using TeradataSQL module in python, but I am getting the following error: A failure occurred while executing rows 1 through 2 of a batch request...Caused by [Version 17.0.0.8] [Session 21731976]…
chulo
  • 53
  • 8
0
votes
1 answer

How to get the total size in bytes for a particular table in Teradata?

I am trying to get an estimate of the size of the data for all rows combined in a given table in Teradata. I checked the documentation but I could not find any relevant information.
Sam
  • 352
  • 2
  • 4
  • 22
0
votes
1 answer

How to find the total number of columns in a table in teradata?

I am trying to get the number of columns in a row for a given table in teradata. I am finding it difficult to find the total number with the usual SQL command. This is what I have tried but did not give me any result: SELECT COUNT(*) FROM…
Sam
  • 352
  • 2
  • 4
  • 22
0
votes
0 answers

Teradata sql query - compare current day value with previous day value

I have 3 columns(CustomerId, Amount, ProcessDate) in a table (Customer). Values are inserted daily in this table. I want to get all the rows whose current day Amount is greater than previous day Amount. CustomerId Amount Process_date 1 20 …
Saurabh Prakash
  • 2,715
  • 1
  • 11
  • 17
0
votes
2 answers

How to duplicate table row based on column value in Teradata?

Can someone help this task? If I have one table as below in Teradata: caseid content repeat id1 row1 2 id2 row2 3 I want to build a new table based on the repeat value as below. How should I…
coco
  • 871
  • 1
  • 7
  • 15
0
votes
0 answers

Adapting Cursor in Teradata SQL

I have a simple Cursor in SQL Server that I would like to adapt to use in Teradata. The goal of the cursor is to collect the names of a series of tables and rename them using cursor logic. I already change most of the cursor code to use in Teradata,…
Felipe
  • 1
  • 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…
V_sqrt
  • 537
  • 8
  • 28
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
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

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…
0
votes
1 answer

Proper filtering of table which contains multiple records within the same account

I need to join table "customer" and table "comment". I want to find out the account created on 3/24/2021 from "customer" table. Subsequently, filtering those accounts that doesn't has the "dormant" word in the "comment_desc" column of the "comment"…