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.
Date as Integer Topic by NewAmigo 20 Feb 2014

Hello,
I am creating a new column in to an existing Date dimension table
 

Alter table DB.Test
Add Date_Key INTEGER;

And updating the field with data from  sys_calendar.calendar
And updating that field with the data SQL Below

3040 views
25 replies, 21 min ago
Teradata String Manipulation, Extract String from a text field. Topic by BLUESTAR 4 hours ago

Hi,
 
I have a field P_ID which contains data like
'ICHIP00~WICHNA01~KD06'
'CHIP00~WIA01~KD70'
'WICH0~WIA01~KD0~I89'
'WIP00~ICH~KD05'
 
I need an output as such
 
Take the 3rd component of the  p_id, which is always after the 2nd ~.  There should not be a 3rd ~, but if there is a 3rd ~, then take what's between the 2nd and 3rd ~.

1 view
2 replies, 45 min ago
SQL help Topic by dvya 16 hours ago

I have table sales and store_id details
sales_id sales_percentage sales_area
1 10 BG
2 20 ch
3 30 as
store id store name
2 ed
3 tr
6 ns
i need output like below
sales_id sales_percentage sales_area store id
1 10 BG 2 
1 10 BG 3
1 10 BG 6
2 20 ch 2
2 20 ch 3
2 20 ch 6
3 30 as 2

15 views
4 replies, 12 hours ago
MonitorSQLSteps Truncated? Topic by cmedved 13 hours ago pm/api

Hi all,
 
I understand that MonitorSQLSteps does not provide the full explain plan - this is fine. However, the text that it is returning is truncated. The definition of the function states that SQLStep is a VARCHAR(128). Our site is running Teradata 13.10.
 

4 views
1 reply, 13 hours ago
Inserting Unicode Characters into a Unicode Field Topic by JoeL 312 15 hours ago insert, unicode, utf8, 6706

Teradata 13.10 is rejecting my insert with the error:
 The string contains an untranslatable character. (6706)
Here is my INSERT statement:
Insert Into CCDW_T.UTest (ucol, i) SELECT 'ɂ',578;
This is my CREATE Table:

14 views
1 reply, 14 hours ago
COLLECT STATS TD V14.10 Topic by Teradata_SA 1 day ago

Consider the following.
I create an employee_table and then create and execute individual collect stats commands as follows

COLLECT STATISTICS on Employee_Table COLUMN Employee_No ;

COLLECT STATISTICS on Employee_Table COLUMN Dept_No ;

COLLECT STATISTICS on Employee_Table COLUMN Last_Name ;

 

I then do a :

14 views
2 replies, 22 hours ago
Union All problem Topic by jporell 28 Jul 2006

Can anyone explain the following odd results?When I execute the following query:select 'x' ,count(*) from dbc.databasesunion allselect 'x1' ,count(*) from dbc.databasesI get the following results:x 193x 193but when I run it this way:select 'x1' ,count(*) from dbc.databasesunion allselect 'x' ,count(*) from dbc.databasesI get the following results:x1 193x 193I don't understand why the literal is change in the first example. This seems to only occur when the literal from the first is contained in the second literal. It also has interesting results with '1x', '3xa','bfgfxj234'....

15583 views
2 replies, 23 hours ago
Hibernate Teradata dialect issue Topic by ronaldcheng6 1 month ago

When using the Spring Tool Suite try to connect to Teradata database but always appear Error message "unable to reslove name org.hibernate.dialect.TeradataDialect " Plz help me fix this issue.Thx!

 

Application setting file is below:

spring.datasource.driverClassName=com.teradata.jdbc.TeraDriver

17 views
4 replies, 1 day ago
'at time zone' not working in UPDATE/INSERTstatement Topic by yasha 2 days ago

Hi-
 
Iam trying to convert timestamp column from PST to EST. In order to achieve that, I used at time zone '+3:00' to add 3 hours. But it is not helping out. The same at time zone works perfectly in a select statement but its not working with update/insert statement.
Any help would be much appreciated!
 
SQLs-
USING AT TIME ZONE- NOT WORKING
 

16 views
1 reply, 1 day ago
Collecting Statistics on Global Temporary Tables Topic by sathish.mni 4 days ago gtt, collect stats

Hi,
Can anyone help me on this question??... For GTT Tables while defining stats which one of the below Query works better?
 1.

collect stats on tablename column ColumnNM/Index

OR
2.

8 views
1 reply, 1 day ago
Failure 9128 The transaction exceeded the maximum number of rowhash locks allowed Topic by GRB 07 Feb 2011 database

Hi,

I am getting the error while executing a simple insert select statement. I have a table Product_Change in NewDB database and a table PC in OldDB database.

insert into NewDB.Product_Change
(
change_app_code ,
change_number ,
abstract ,
Author_Person_App_Code ,
Author_Person_Id ,
owner_Person_App_Code ,
owner_Person_ID ,
Created_Datetime ,
Last_Change_Datetime ,
TARGET_CLOSE_DATETIME ,
Close_Reason_Code ,
Class_Code ,
Priority_Code ,
Customer_Impact_Code ,
Found_In_Activity_Code ,
Last_Change_Login_ID ,

6409 views
3 replies, 1 day ago
Transpose rows to columns Topic by Sarah_07 23 Oct 2013 transpose, pivot

Hi All,
I'm new to TD. I need to transpose data from rows to columns. I'm not sure how to do it using PIVOT in teradata. Can anyone help me.
Sample input data.
ID Name English Maths Science
123 ABC   90       95       95
345 CDE   70       80       90
 
My output should look like,
ID Name Subject Marks
123 ABC English  90

17507 views
21 replies, 1 day ago
ALTER TO CURRENT Topic by Teradata_SA 1 month ago ALTER Table TO CURRENT, TO CURRENT, timezone

I need to understand what the issue is with time_zones and ALTER TO CURRENT and why the query plan changes if we dont add intervals. IE a translation into English would be good :-)
This is from the Teradata Documentation.

14 views
4 replies, 1 day ago
Patching and Versioning Topic by DBResearch 28 Jun 2011 update, patch, fix, version

Hello,

As part of my job, I have to understand the patching model of all databases our clients are using, in order to assure maximum security level. I have a couple of questions regarding the database, and I couldn't find the answers I was looking for online. Hope you can help me here,

1. Is there somewhere online we can see a list of all patches released for the DB? We are mostly interested in Security updates.

2. Is there some fixed date for patches? Like, for example, a new patch is releases every 2 month?

1651 views
1 reply, 2 days ago
34 views
4 replies, 2 days ago
Question on Aggregated Join Index Topic by N_Raghu 5 days ago aji

I read that it is not recommended to have non-partitioned JI on partitioned base table from a performance point of view. So I have a large table in production with this case. I know I have to test it but want to check with you to see if it is worth spending time to add partitioning on AJI as the performance is ok right now with out the partitioning. 
-Raghu

7 views
2 replies, 2 days ago
Querying data for time period Topic by odivini 5 days ago

Hi All,
I’m a new Teradata user and trying to create SQL to pull appropriate device for a specific bill period. Appreciate your help with writing SQL accurately.
Data tables:
 

USER_ID

CHARGE_AMT

BILL_ST_DT

BILL_END_DT

 

A

5.00

12/2/2014

1/2/2015

 

B

23 views
3 replies, 4 days ago
Encryption in Teradata Topic by dins2k2 1 month ago encryption, teradata

Hi All,
How encryption happens in Teradata? What are the different levels of encryption defined in Teradata? And of course decryption too.
Thanks,
Dinesh

42 views
5 replies, 4 days ago
RuleType in tdwm.ruledefs Topic by Kishore_1 26 Jun 2014 RuleType, tdwm.ruledefs

In tdwm.ruledefs table, ruletype=5 means the ruletype is for Workloads in the system.
What does ruletype=1,2,3,4 denote?Where can I get this information.

107 views
2 replies, 4 days ago
update syntax Topic by kevin4423 4 days ago #UPDATE

table_1
(
c1 int
,c2 int
,c3 int
);

insert into table_1 values (1,2,3);

update table_1
set c2 = c2 + 5 --c2's value suppose to be 7 now
,c3 = c2 + c1; --c3's value suppose to be 7 + 1 = 8 now

select c1, c2, c3 from table_1;

10 views
3 replies, 4 days ago
Zofran | Farmacia Buy 4 Mg Con La Rebaja Topic by chamoisstoat 4 days ago

Looking for cheap zofran? Not a problem! Click Here

1 view
0 replies
QUERY IS RUNNING LONG TIME(40 MINS) TO EXTRACT 1 LACK RECORDS Topic by Kumar@TD 5 days ago

Hi All,

THE BELOW QUERY IS RUNNING LONG TIME(40 MINS) TO EXTRACT 1 LACK RECORDS.
WHEEN WE RUN SELECT PART, ITS EXTRACTING QUICKLY IN SECONDS.
WHEN WE RUN THE TOTAL QUERY ITS TAKING 40 MINS TO COMPLETE

13 views
3 replies, 5 days ago
Various UPDATE Scenarios Topic by TDW 5 days ago

Hello,
I have been checking the Internet for the syntax for the UPDATE statement. It seems there are many different ways to write an UPDATE statement and I am confused by the various examples.
Some examples use a derived table. Others an INNER JOIN.
Some place the "SET =" as the next line after the UPDATE. While others place SET is the last line of the SQL.

7 views
0 replies
overflow occured computing an expression involving Topic by john_89 6 days ago

Hi All,
   I am facing some challenge in dividing two decimal numbers and updating a target decimal column.
one important thing there few zeros are there in source coulmns(actual_amt and amt_allowed)
Datatype
actual_amt decimal(9,2)
amt_allowed decimal(9,2)
percent_col decimal(5,2)
expected is
actual_amt/amt_allowed*100-->percent_col

16 views
4 replies, 5 days ago
TASM Topic by RanjaniKartik 6 days ago TASM-AWT

I was pondering if any one has a pre written query willing to share.. Iam basically revisting TASM settings on my system
Here is my question:
I have close to 15 workloads and i want to know if AWT usage can be tagged to particular workload...? If i have that info then i can see the AWT usage with each workload and probably look at throttling that workload..

5 views
0 replies

Pages