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

My Python script gets stuck when i load data into CSV from Teradata and won't continue to run

The script saves the data to a csv file, this is the cur.execute command, and then nothing happens, just hangs in the same place, print(0) never prints exit(),quit(),sys.exit() does not help import teradatasql def…
Vitaliy Korolyk
  • 182
  • 2
  • 6
0
votes
0 answers

Partition eliminations with multilevel partitions on teradata database

I have a performance issue with multilevel partitioned tables on teradata database. It seems the partition elimination is not occurring if a table has a certain kind of partitioning structure. As an example, consider the following table and query.…
Kota Mori
  • 6,510
  • 1
  • 21
  • 25
0
votes
0 answers

how to check specific partition data in teradata

I have created a table with partition on ID columnPARTITION BY RANGE_N(EmpId BETWEEN 1 AND 10 EACH 1 );. I want to check specific partition data. For example partition 1 total number of rows 10, partition 2 total rows 5. is there a way to check…
Alia
  • 33
  • 5
0
votes
0 answers

TERADATA SQL Case when FAILED[2620] THE FORMAT OR DATA CONTAINS A BAD CHARACTER

I have a table containing faults for different products, each row is a fault. The table has the following three columns: ID, Category1, Date. The column Category1 type is VARCHAR(1300) and it contains either number from 0 to 999 or string. I need to…
tc222_cz
  • 3
  • 4
0
votes
0 answers

LIMIT keyword is unknown by Teradata Database

I am using jdbc_static plugin with a simple select query jdbc_static{ id => "JDBC_STATIC_APPLICATION_MIND_MAPPING" loaders => [ { id => "REMOTE_MAPPING" query => "select field1, field2 FROM DB.view" …
0
votes
1 answer

SQL where conditions from 2 columns are met

Question edited #TEMP_TABLE data: | Serial Number | ORIG | DEST | | ------------- | ---- | ---- | | 12345 | CAN | YOW | | 67890 | YYZ | PEK | | 13579 | PEK | YVR | | 24680 | PVG | YOW | | 15764 | YVR …
0
votes
0 answers

Creating a procedure with a call to another procedure in teradata

I have a procedure that returns a list when requested - test_1. I want to create a procedure that sends each value from a table type_cd_list to the procedure test_1 and returns a list, but I get an error: An existing result set Cursor is opened…
0
votes
1 answer

Using variables in a teradata query

I have a request that includes a variable. But when executing the query, it does not display the result. I don't see the details of the error. What's wrong with the request? DECLARE SQL_TEXT VARCHAR(3000); DECLARE NumberInst VARCHAR(100); SET…
0
votes
1 answer

SQL question: vlookup equivalent in SELECT

My T1: ROUTE_NAME ASE DTW BLI DTW DTW MOD DTW OGG DTW VPS DTW LAS T2 is the lookup table which has two columns: airp_cd city_cd UPP UPP MUF MUF PPU PPU CGV CGV DTW DTT I'd like to get the city pair by looking up the…
0
votes
1 answer

Update fields using Self Join - Teradata

I want to update CHAT_ACTIVITY_ID & CHAT_SMS_IND field in a table ABC.PERFORM_METRICS_F(History correction) using INTERACTION_SOURCE_KEY based on below criteria: If CHAT_ACTIVITY_ID is NULL, update it with the CHAT_ACTIVITY_ID which is not null for…
0
votes
1 answer

Iterative Running Sum in SQL

I want to create a running sum in sql that starts over each time it surpasses the value of 90. I have a list of dates, and once 90 days have passed since the original date I want it to start over at 0 again, iteratively. Below is my current code…
Justin B
  • 29
  • 7
0
votes
0 answers

Calculating incremental values from a cumulative sum field in Teradata

Good afternoon - I have a table in Teradata that stores a rolling cumulative sum that resets every month. I would like to be able to calculate the incremental gain between each day of the month. Is this something that I can accomplish with olap…
ChrisCamp
  • 672
  • 1
  • 5
  • 20
0
votes
1 answer

Teradata TPT job is successful in case there are records in Error Table 2

I have teradata TPT job defined, there is Error Limit =1 set in Update operator. When there are records in Error Table 1, the job fails, but when there are records only in Error Table 2, the job is successful. How do I make it fail in case of Error…
0
votes
0 answers

Connect to Teradata in Python

I have a script that uses a model and creates a big table for a client, and the last step is to save the result in a Teradata table. Currently I'm using teradatasql in this way: SubCat_p is the final dataframe that I have to save in a table that…
Jero
  • 15
  • 1
  • 6
0
votes
1 answer

Select Statement getting overridden in job variables file

I'm running a tdload command using a job variables file with values : SelectStmt = 'select * from database.tablename where column1 > 100', SourceTdpid = 'hostid', SourceUserName = 'username', SourceUserPassword = 'password' SourceTable =…
krx
  • 85
  • 1
  • 7