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
0 answers

Granting Rights on Teradata Database that Contains " - " and " . " in its Name

I have a teradata query that is mentioned below Grant Dump, restore, select on FAD-Data.Practice to Backup_1 It is giving me error that something expected between the word Fad and '-' The database name is not correctly written but how can I make…
0
votes
0 answers

Upload batch with NaN or NaT values to Teradata using TeradataSQL python module

I have a table that I want to upload from one platform (SQL SERVER) into Teradata. Normally I use the TeradataSQL module in python to do this but this is the first time I run into issues with NULL values. When I upload it into pandas, they show as…
chulo
  • 53
  • 8
0
votes
0 answers

Teradata Fastload inserting Null when the field has value empty string ("")

I am using TTU (fastload) to load data into DB table. Following is the fastld script for data load: LOGON 127.0.0.1/test,*****; DATABASE MyDb; BEGIN LOADING "MyTable" ERRORFILES error_table_1_607712459, error_table_2_1744826307 CHECKPOINT 0;…
0
votes
3 answers

How to generate dynamic table having begin month date and end month date Teradata or SAS SQL

I’d like to generate a dynamic Table with the start date of a month as a column and the end date of the month as another column. Ideally, I’d like to provide two years, f.e. 2016 and 2021. The output I’d like to have when providing these two years…
Eren
  • 73
  • 1
  • 2
  • 8
0
votes
1 answer

How to populate new column by comparing one row with its next row

I am finding difficulty in writing a query to get the desired output. I need to get date difference between two consecutive rows and If date difference is <=6 months and reason code is valid "Yes" Then new column should be populate with values…
0
votes
2 answers

How to create 2 new columns from name and surename included in 1 column in Teradata SQL?

I have table in Teradata SQL like below: NAME Johnson Simon Whats Ann Pitt-House Mark Grahap Michael Josh This table in column: "NAME" contains name and surname of clients, but be aware that sometimes clients can have two-membered…
dingaro
  • 2,156
  • 9
  • 29
0
votes
1 answer

What happens when you add a where/filter clause on a select view when the view already contains the where/filter clause inside?

I am using a union inside a view and filtering out all items that has EQ or NECF as shown below: REPLACE VIEW X.VIEW_NAME AS LOCKING ROW FOR ACCESS SELECT * FROM X.TABLENAME A WHERE A.SIS <> 'EQ' OR A.SERVICE_NUMBER <> 'NECF' UNION ALL SELECT * FROM…
Jonathan Lam
  • 1,237
  • 3
  • 20
  • 49
0
votes
1 answer

Complex Scenario Teradata Query From Single Table

QUESTION : Fetch the records that are having type='Onsite Repair' as well as the records that have Type in ('Calibration', 'Interface Troubleshooting', 'Setup/Configuration','Customer Applications') only when there is also a row with Type='Travel'…
0
votes
1 answer

SQL: 4 transfers in different months within the last 6 months and specific words in title in Teradata SQL?

I have table in Teradata SQL like below: And I need to select only these rows, where: In title has (in any configuration, not case sensitive) words: "cash" or "pay" Have had at least 4 transfers in different months within the last 6 months…
dingaro
  • 2,156
  • 9
  • 29
0
votes
1 answer

Complex problem of rewriting code from SQL Server to Teradata SQL?

I have in Teradata SQL table like below: col1 | col2 ---------------------------- Adam Nowak PHU | Nowak Adam AAR Kowal Jan | Kowal Jan Tomasz Gut | Juk Anna And I would like to select only these rows where: In col1 I have…
dingaro
  • 2,156
  • 9
  • 29
0
votes
0 answers

Teradata SQL: select rows based on values in two columns where order of name and surname is not important in Teradata SQL?

I have in Teradata SQL table like below: col1 | col2 ---------------------------- Adam Nowak PHU | Nowak Adam AAR Kowal Jan | Kowal Jan Tomasz Gut | Juk Anna And I would like to select only these rows where: in col1 I have…
dingaro
  • 2,156
  • 9
  • 29
0
votes
0 answers

Dynamic SQL calling another stored procedure in Teradata

I've seen in the help guides that you cannot use a call statement in a teradata dynamic sql statement without output parameter. I assume this implies I can, If the proc has an output parameter. has anyone done this? Scenario - I have a table that at…
Dan
  • 13
  • 4
0
votes
0 answers

Custom stored procedure in Teradata SQL

In the past I adapted a cursor I have in a stored procedure on SQL Server to Teradata but I'm having some troubles trying to use. My procedure code is: CREATE PROCEDURE sp_QrRnTables() BEGIN DECLARE varTableOldName VARCHAR(500); DECLARE…
0
votes
2 answers

create a view to cater to dynamic month

a subquery is provided to create a view and the view should cater to dynamic month variable. the subquery like this: select col1,col2,col3,col4, sum(money) as KPI_single_month from table1 group by col1,col2,col3,col4 where month='202104' -- month…
fred wu
  • 55
  • 6
0
votes
1 answer

No more spool space in Database (Teradata)

I am a beginner in SQL and I have a problem with one of my queries on Teradata. When I run it, I get this error: "No more spool space in Database". According to my research on the Internet, the problem would come from the fact that my query is not…