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

Expected 11 bytes, field contained 26 bytes

I'm trying to import data from a csv file into Teradata using tdload utility with the following command: tdload -h TDPID -u dbc -p dbc -t DemoTable -f demofile.csv -d ',' --TargetWorkingDatabase AdventureWorksDW --TargetErrorLimit 100 jobid I get…
linux
  • 157
  • 11
0
votes
0 answers

Export in parquet file format in Teradata

I am trying to export data using the TDload utility of Teradata and I need the exported file to be in parquet format. The command I have used is: tdload --SourceTdpid xxx.xxx.xxx.xxx --SourceUserName dbc --SourceUserPassword dbc --SourceTable…
linux
  • 157
  • 11
0
votes
1 answer

User does not have CREATE TABLE access to database DBC

I am using the tdload utility of Teradata to import data into an existing empty table in my database. The command I'm running is : tdload -h 192.168.xxx.xxx -u dbc -p dbc -f path/to/file.csv -t AdventureWorksDW.DemoTable MyJob I get the following…
Gary
  • 31
  • 1
  • 6
0
votes
0 answers

Getting a ANY or ALL Error in Teradata SQL Code

I have a Teradata SQL code select SUM(col_A)/COUNT(col_A) from table_A where col_B in (select col_C from table_B where col_D in ('1','2','3') and col_E = 'N' and col_F = 'AC' and col_G…
Rogue258
  • 109
  • 1
  • 9
0
votes
0 answers

expected something between the beginning of the request and the 'IF' keyword error when using IF in TeraData

I am trying to make a "drop if exist" in TeraData with the following statement SELECT 1 FROM DBC.TABLES WHERE DatabaseName = 'test1' AND TableName = 'test2'; IF ACTIVITYCOUNT = 0 THEN .GOTO l2; -- no result, skip SQL 1 DROP TABLE…
0
votes
0 answers

Teradata Date format converion from varchar to date

I'm stucked somewhere in Teradata date conversion. Can anyone please help, thanks in advance. Table name is Test2 Table attributes are defined as: Acct_id Integer, Date_num Varchar(10) Character set Latin not casespecific Sample Data: Acct_id …
Bikash
  • 11
  • 1
0
votes
1 answer

facing issue with python while connecting to teradata

Traceback (most recent call last): File "/Users/GA20081466/Desktop/LH_Imeitool/scripts/replication.py", line 93, in with teradatasql.connect(host="xxxx", user="xxxx", File…
Neeraj
  • 1
0
votes
0 answers

what is the difference in Teradata (ANSI SQL) and Oracle/My SQL regarding sum(x) over (partition by y order by y)?

Original Table X as : ID START_DATE END_DATE GRP 001 2017-10-15 2018-10-21 1 001 2017-10-15 2019-10-21 0 001 2020-05-18 2021-05-03 1 select ID, start_date, end_date, sum(grp) over(partition by ID order by start_date, end_date) as…
Yumeng Xu
  • 179
  • 1
  • 2
  • 11
0
votes
0 answers

How to improve Teradata query for pagination?

Hi Guys i'm trying to use pagination for my teradata query as below: SELECT RANK() OVER (ORDER BY id,firstname,lastname,grade,gender,age,profession) as row_num, ORDER BY id,firstname,lastname,grade,gender,age,profession FROM table-1 QUALIFY row_num …
james11
  • 55
  • 6
0
votes
0 answers

Teradata: Date value division with 365 days

Needs an update what exactly the below query does when it divisible by 365?? select CAST((FLGHT_DATE )/365 AS INTEGER); Note: FLGHT_DATE column is of date type and in YYYY-MM-DD format.
0
votes
0 answers

Teradata Procedure Locks a Log Table

I am trying to get around a problem where the following SP locks the log table DWH_METADATA.LOG_TABLE and the lock is released only when the DELETE ALL and INSERT-SELECT statements are executed. This procedure chokes the whole ETL process. Moreover,…
Burhan Khalid Butt
  • 275
  • 1
  • 7
  • 20
0
votes
1 answer

sqltextinfo gets truncated while copying to excel

I need to get a column 'sqltextinfo' from log table but the text is not correctly placed in a cell when I copy it to excel. I tried the following query to get this. But it throws error -9134 result exceeded maximum…
0
votes
2 answers

How to export Varbyte in Teradata

I have a table with example data as follows: Num JobId 1 12345678 where Num is of Integer datatype, and JobId is of Varbyte datatype. I need to extract it, and the TPT script I have used for this is: USING CHARACTER SET UTF8 DEFINE JOB…
linux
  • 157
  • 11
0
votes
1 answer

How to decare a variable in Teradata sql and call them in a select statement?

I want to declare two variable and use thoes variable in where condition of a select statement in teradata, but I am getting an error in that. Create Procedure Demo() Begin Declare REnd Date; Declare RStart Date; Set REnd = (select…
0
votes
1 answer

How to write this SQL Server query in Teradata SQL?

We are migrating the data from SQL Server to Teradata and I am unable to replicate the same code from SQL Server to Teradata. Description: I want to generate report between the dates received from the Rstart and Rend, which is basically 6 month…