Teradata CASE WHEN attribute IN SELECT

I have 2 tables in Teradata - "a" and "ch". Table ch contains 2 colums "amt" and "code". Between tables "a" and "ch" is LEFT JOIN. Join is made, and in the SELECT part I am trying to SUM amt...

How to extract Stored Procedure body in Teradata

I'm trying to extract Stored procedure DDL by querying system tables. If I run the following query **select * from dbc.tvm where TableKind = 'P'** both fields RequestText and CreateText contain...

How to get distinct values based on one parameter?

I am using teradata to pull some staff select eventid, personid ......... ....... I need to select distinct values base ONLY on the eventid parameter, so the i want to apply distinct to eventid,...

How to convert big-number to varchar in Teradata

I have a float-type-field which contains big number (more than 20 digits). Then I want to convert it to varchar, without rounding. I tried several queries, but nothing. Here is for example...

How to import Date from .CSV to Teradata tables using Bteq?

I am trying to import the data which is exported by using Bteq script but not able to load into another table. .EXPORT report file=E:\t\tgt\report_excel_092702.csv; .set width 200; .SET...

removing speciacl characters from teradata coloumn

how to remove special characters from Teradata columns. I am having columns values other than characters A-Z and numbers 1-9, how to remove theses column values as we don't know the exact special...

Teradata JDBC Error 1338 after certain number of batch executions

I am trying to insert 3.8M records into a Teradata table containing 14 columns, through a batch of 10000 records using RJDBC package of R. It always crashes after inserting 380000 records i.e. at...

SQL/Regex Challenge/Puzzle: How to remove comments from SQL code (by using SQL query)?

Requirements Single-lines comments (e.g. -- my comment) should be removed. Multi-line comments (e.g. /* my comment */) should be removed. The content of strings literals (e.g. 'this is a...

Teradata view has space in field name that I cannot change...how do I write select statement with where clause

VIEW Definition DBName.ViewName AS LOCKING ROW FOR ACCESS SEL MATL_ID , CD "Company Code" FROM DBName.TableName; Please note I cannot change the view - I can only...

Teradata Python: teradata.api.InterfaceError

I have a simple select query from a python script to select data from Teradata DB shown below, session.execute("select distinct v_column from a_table where a_column in (?)",(value)) Value in this...

Calculating business days in Teradata

I need help in business days calculation. I've two tables One table ACTUAL_TABLE containing order date and contact date with timestamp datatypes. The second table BUSINESS_DATES has each of the...

2665 - Invalid Date Error in Teradata

I'm trying to complete an insert into statement but keep getting a "Invalid Date" error as a result. My create statement: CREATE MULTISET TABLE Date_Table, NO FALLBACK , NO BEFORE JOURNAL, ...

Error: String contains an untranslatable character - TERADATA (for REGEXP_REPLACE operation)

I need to clean one character column and for that I am using REGEXP_REPLACE function in Teradata 14. The same piece of code worked for some other data source (having the same LATIN encoding). The...

Data migration from teradata to bigquery

My requirement is to migrate data from teradata database to Google bigquery database where table structure and schema remains unchanged. Later, using the bigquery database, I want to generate...

alexbrainman/odbc golang package for odbc connection panicking

I am trying to use alexbrainman/odbc package to connect to teradata, but it is panicking with the following error. I am running this on Linux 4.6.0-1.el7.elrepo.x86_64 -bash-4.2$ go run...

How to handle new line characters in hive?

I am exporting table from Teradata to Hive.. The table in the teradata Has a address field which has New line characters(\n).. initially I am exporting the table to mount filesystem path from...

Calculate time difference in Teradata

I have a scenario to calculate difference of timestamp in minute. There is one common field in 2 tables i.e dw_job_id and want to join 2 tables and guessing,...

What is Teradata's equivalent for Oracle's DUAL

In Oracle, we can write this to generate a single row using a SELECT statement. SELECT 1 AS x FROM dual What is Teradata's equivalent?

Liquibase preconditions: How do I check for a column being the correct data type?

I have a db upgrade script to change some datatypes on a few columns. I want to do a preCondition check, and call ALTER TABLE only when it is a DECIMAL datatype, but I will want it to be changed...

pyodbc truncates column names

I'm using python 3.6.2, pyodbc 4.0.23, to access Teradata 15.10.07.15 on Ubuntu 16.04. The teradata driver I have installed is tdodbc1620 16.20.00.36-1 amd64 SIMBA Teradata ODBC driver...

Oracle Database Connection type missing on SSRS

Like the title says, I cannot select the "Oracle Database" on my SSRS site. Checked the Server Version. Windows Server 2016 Standard with SQL Server 2017 Developer Edition...

Teradata Sub-string Before and After certain character

I am looking for a way to extract text that is before and after a certain character in Teradata. For example, I have a column that is consistent except for the word in the middle - which I want to...

Connect to Teradata Database using R + DBI library + ODBC

I'm trying to connect to a Teradata Database in R using the DBI library (if it matters I'm on Windows). I can successfully connect using the RODBC library so I know my credentials etc. are...

Why is my prepared statement, generated by Spring Data and Hibernate, 'null'?

I am attempting to connect to Teradata using Spring Data JPA, which itself is using Hibernate. I can retrieve objects fine, but I cannot store them. It seems like my JPA Entity is compatible with...

How to identify Weekdays in Oracle?

Good Morning, I am trying to find an alternative to Weekday for Oracle, for some reason our version does not recognize the Weekday function. It keeps throwing an error, WeekDay: Invalid...

Is there a way to handle Amazaon S3 credentials through environment variables in Teradata TPT script

I am setting up my terdata TPT script with S3 and want to use environment file variable in TPT script for amazon S3 credentials instead of hardcode Access key, accessId & region. Any...

Migrating data from Teradata to BigQuery

I'm running Teradata express on VMWare player. In order to migrate the data to BigQuery I'm trying to follow the official documentation capturing BigQuery transfer...

How can i connect to Teradata using python. I am using teradatasql package but getting error

I am trying to connect to teradata using teradatasql module. But getting connection refused error . I am using below codes for same. Is there any way to connect to teradata for same. connection =...

Python bulk insert to Teradata? Default is too slow

I was asked for a Python script to read a file, load into a dataframe, and write to a table in Teradata. It works but it takes 3-4 minutes to write a table that's 300 rows. Now that's a tiny job...

SSIS package with Oracle Connection Attunity: The ORACLE registry key cannot be opened

Please could someone help me on similar/same issue as in this TOPIC - SSIS package that connects to an oracle DB using Attunity Connection Manager My environment situation is: DEV Virtual...

Relevant tags