All Forums

Topics related to the Teradata Database, excluding database connectivity (e.g. JDBC) and extensibility (e.g. UDFs) . Typical topics are about SQL syntax and usage (SELECT, GROUP BY etc), database performance, use of database functions, comparison with / migration from Oracle or DB2, and generally why the Teradata Database rocks. For articles, blogs and more, see the Database section of the site.

You must login to post to the forums.
How to make substring with the second or third occurrence of a charater Topic by zorbax19 25 Oct 2013

Hi,
I would like to take part of the string below by specifying a delimiter and an  occurrence.
EQN = AAL53CCW_400-5-13-3
If I want to recover what is on the left of the first occurrence of  '-' I can write SUBSTRING (EQN FROM 1 FOR POSITION ('-' IN EQN) - 1) which gives me  'AAL53CCW_400'

13619 views
8 replies, 3 years ago
Use teradata with jmeter Topic by bhushan.koli 18 Aug 2016

How to use jmeter with teradata to get performance stat?

154 views
3 replies, 3 years ago
377 views
4 replies, 3 years ago
How to use regex in Teradata or 'LIKE' operator in teradata Topic by netuser 15 Jan 2014 #teradata, #sql

I have a table tab1 with structure as-

    columnName | datatype
          col1 | VARCHAR  
          col2 | VARCHAR
          col3 | VARCHAR
          col4 | VARCHAR
          col5 | VARCHAR

 and sample data as

5703 views
5 replies, 3 years ago
Teradata Query-URGENT Topic by Kuldeepg92 18 Aug 2016

There is table with coulmns:
INTL_EMP_ID
PRSCT_FILL_ID
ACTVTY_TS
EMPLYE_NBR
EMP_ID
 
Problem Statement: select INTL_EMP_ID from table for that PRSCT_FILL_ID.
order by ACTVTY_TS in ascending order and get the first EMPLYE_NBR and its corresponding EMP_ID.
 
Thank you.
 

168 views
2 replies, 3 years ago
SQL Error on 'Create Table' in Terdata SQL Assistant Topic by ap0167 17 Aug 2016 teradata

why I am getting a syntax error?
 
create TABLE  ddwp_v.sponsoredm, CHECK = DEFAULT
(account VARCHAR(12)
 Unique Primary INDEX(account);
insert into ddwp_v.sponsoredm
VALUES(?);

 

228 views
1 reply, 3 years ago
terdata query. Topic by Kuldeepg92 16 Aug 2016

 The gender with the minimum number of students should only pair with opposite gender. The remaining students of the opposite gender can pair among themselves.
 
1.       One student can only be paired with another student.
Ie, if (stud1,stud2) pair exists, there cannot be another pair (Stud1,Stud3) or (Stud3,Stud1)
 

158 views
5 replies, 3 years ago
Results differ between query applied on single and query applied on whole branch accounts Topic by khawar.ameer 17 Aug 2016 #database #teradata #sql

Dear All,
Please refer this
ACCOUNT_NUM = 680213
BRANCH_PARTY_ID = 12311
Both ACCOUNT_NUM and BRANCH_PARTY_ID are part of EVENT table.
Account No 680213 is part of branch 12311
I run following query on single account [mentioned above i.e. 680213] and it gives me 209 records of Account # 680213. Here is the query

139 views
0 replies
Substitute for "LIKE" in teradata Topic by manaswi_patil 16 Aug 2016 #database #teradata#sql

Hi All,
Could anyone please help me and suggest a function/ expression/ operator in Teradata to write a query that would return a set of rows which include any single character between 'A-P'.
I'm looking for a operator like 'LIKE'.
I have tried regexp_like and regexp_similar but the results were not as expected.
Let me know in case any more details needed.

120 views
2 replies, 3 years ago
Console user/db Topic by Sidhharth 10 Oct 2011

Hi Folks,

 

Can some one tell me regarding the usage of Console user/db in Teradata ?

 

 

2407 views
4 replies, 3 years ago
Creating a snapshot from Type 2 behaviour Topic by sbloomer 16 Aug 2016

Hi all
We have a situation where we need to create (in a view) a snapshot from Type 2 dimension behaviour

89 views
1 reply, 3 years ago
Spool space error 2646 collecting statistics Topic by lgscheurich 16 Aug 2016 collect, statistics, spool, 2646

This is a new one for me.  When I run the command below, I get a spool error.  The table has about 620 million rows in it.  Can someone please suggest what I need to do in order to resolve this?
COLLECT STATISTICS
  USING THRESHOLD 5 PERCENT
    AND THRESHOLD 7 DAYS  
  COLUMN (EDW_CHECKSUM1) ON DW_ACQ_T.CLY_CLARITY_TDL_TRAN;
Thanks!

191 views
1 reply, 3 years ago
Copying Macro one DB Server to another DB with changed Internal Tables wrt to the new DB instance Topic by Karrajan 16 Aug 2016

Hi All,
 
I need to copy a macro from old DB instance to new DB instance but the objects inside the macro will remain the same as the old DB name but i need to the objects inside the macro too to be changed according to the new DB objects.
 
Thanks,
Karthick.

103 views
1 reply, 3 years ago
SQL query needed---Urgent Topic by krishna1985 15 Aug 2016

Hi All,
I have source data as
Month         x                   y
Aug 14     3000            2000
Sep 14      4000           3000
Oct 14      5000            44444
 
I am looking to create a calculated field that will return a percentage change in volume when compared to the previous month (for each column). 

193 views
3 replies, 3 years ago
Caught an error when update GRAPHIC column Topic by franceszhu 16 Aug 2016

I tried to update a GRAPHIC column with suggested GRAPHIC string literal format, but caught errors.
 
First, I tried the format G'<xxx>' in the value, for example:
 
update test_table set graphic_column=G'<A>' where id=1;
 

95 views
0 replies
Substitue for Bulk Collect in Teradata Topic by alokku55 16 Aug 2016

Hi Everyone,
 
I am currently working in a project where i need to move all database objects from Oracle to Teradata.
In this project, I need to convert all PL/SQL to Teradata compatible code.
Could you please guide me how to implement the bulk collect concept in Teradata.

93 views
0 replies
Datatype of a Column of a View Topic by mkappel@appfluent.com 12 Mar 2012

I need to be able to select the datatypes of all columns of a view.  Since the Columns view does not provide this information (i.e. the ColumnType and other useful fields are null), I've seen two answers:  The first suggests using "help columns <viewname>.*".  The second suggests using "select type (<viewname>.<columnname>)".

13748 views
8 replies, 3 years ago
Performance Issue - Left Join vs Update Topic by CrayRay 15 Aug 2016

Hi everyone, I have 2 tables as below:
 
Main (20 mil rows, 50 other columns):
Col1  Col2  Col3
a       2      3
b       2      2
 
Join (50 mil rows, 20 other columns):
Col1  Col2  Col3
a       1      1
a       2      2
a       3      3
b       1      1
b       2      3
b       3      2
 

101 views
0 replies
A table with non-latin characters in table name and column names doesn't display properly Topic by franceszhu 05 Aug 2016

Hi, I created a table with non-latin letters in both table name and its column names without any error. However, the table name and its column names are not displayed properly. They are all in random characters, not in the Chinese letters or Korean letters that I expect.
Here is the table creation DDL:

CREATE TABLE "Country_国家_국가_Страна"

(

ID integer,

218 views
3 replies, 3 years ago
Bteq import the output characters got cut off by 2 Topic by HanC 14 Aug 2016 bteq, database

Can anyone please help?
I have a source text file look like below char(10), 20K count of records,  but the output got only 8 characters and the last two got cut off (i.e. 12345678).
 
MbrID
1234567890
0123456789
 

176 views
2 replies, 3 years ago
Capturing MAX marks for Each Student when the MArks are in Columns Topic by sam141988 11 Aug 2016

 
Consider the Below Scenario  -
ID|MATHS|PHYSICS|CHEMISTRY
1|50|60|70
2|70|60|40
3|50|80|70
4|50|100|70
5|90|60|70
 
I want to get the Result where it will display the maximum marks which the Student has got!
Result Would be-
ID|Mark
1|70
2|70
3|80
4|100
5|90
 

395 views
13 replies, 3 years ago
utf8TO16 : why is it Latin to unicode conversion function when utf8 itself is unicode encoding? Topic by kallu2020 07 Mar 2014 utf8, utf16, latin

UDF : utf8to16 function:
why is it known as Latin to Unicode conversion function when utf8 and 16 both represent unicode encoding?

4019 views
10 replies, 3 years ago
Need help with interdependent calculation using result from previous row Topic by dbrown 03 Aug 2016

Hi all, I've run into a problem that I'm having a hard time solving in Teradata. I have a query that returns a cust_id along with sell_date and a date_span (number). From that one date and number value, I need to create two calculated dates that are interdependent. One is an adjusted_sell_date, and the other is an "end_date".

247 views
9 replies, 3 years ago
Teradata Tools and Utilities - Windows Installation Package Release 15.00.00.00 Topic by rharitha7 03 Sep 2015

Is it safe to download from this site 
https://downloads.teradata.com/download/tools/teradata-tools-and-utilities-windows-installation-package.
Cos I'm getting an warning :This program is protected by copy right law and international treaties. while running an .exe file.
 
Thanks in advance.

711 views
1 reply, 3 years ago
Can we find out Column Level Mismatches between 2 Tables in Terdata? Topic by sam141988 11 Aug 2016

I mean to Say when we do a MINUS on TD it returns the Entire Row where the Mismacth is Found. My Question is is there any possibilty where we can find the Column Where Mismatch has Occured and not the Full Row?
 
 

130 views
2 replies, 3 years ago

Pages