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.
why coalesce around time interval calculation does not work ? Topic by Ike 1 hour ago coalesce, Date Interval

Hi guys,
 
does anybody know, why coalesce around time interval calculation does not work ?
This works ok :
cast( (dr.CDS_RRRRMMDD_Trigger - P.party_indiv_birth_dt) as Interval YEAR) as Age
 
This doesn't :
coalesce( cast( (dr.CDS_RRRRMMDD_Trigger - P.party_indiv_birth_dt) as Interval YEAR) ,-1) as Age
 
 

1 view
1 reply, 8 min ago
Untranslatable Characters Topic by yarinzim 5 days ago untranslatable character

Hi Guys,
I have data coming from external source which i'm trying to insert into a static table.
the data sometimes contains corrupted characters and of course will not be recorded.
I'm looking for a way to replace these corrupted characters, since my main priority is a successful recording process and not data integrity in this case.
 

12 views
2 replies, 1 hour ago
Extend Partition Behavior Topic by brokenp87 1 hour ago partition, Range, extend, primary index, range_n, partitioning

Hi all,
I was extending the partition of some tables to host the 2015 and I have notice this strange behavior.
I have this table called Table1

0 views
0 replies
Question regarding RIs Topic by nick2408 1 month ago

Hi all
I have been trying to do some test cases and see that when a normal FK is created, we get a _0 table name as well. I have reviewed other discussions on the forum related to this topic and came to know that this table is created when the chck is performed by database and is called a Hard RI.

38 views
2 replies, 5 hours ago
Error Table Topic by Marcodv1 7 hours ago

All,
 
Suppose the followiing statement has been executed where table Customer_Err is created based on Customer as an error table
Create error table databaseX.Customer_Err for databaseY.Customer.

4 views
2 replies, 6 hours ago
teradata Topic by jillalakk 12 hours ago

How days are Required to learn Teradata

6 views
1 reply, 12 hours ago
3 views
0 replies
Capture Query transfer volume Topic by StevenSchmid 5 days ago query volume

Hi
Is there anywhere that captures the volume (i.e. MB, GB) of data prodcued by a query, that is then sent back to the client.  In the query logs we can see the query execution times and the number of rows returned as well as the IO count, but is there a measure of data volume that is returned to the customer ?

8 views
1 reply, 1 day ago
wanted to get interval time in the format of Hour:Minute:Seconds Topic by ss29 4 days ago

Hi Guys,

 

I have ID's with multiple TASK_END_TIME and TASK_CRETD_TIME for different task in the below format

 

3/18/2005 15:50:04.000000 and 3/18/2005 14:30:30.000000 respectively.

 

Now firstly I would require total cycle time in the format of "Hour:Minute:Seconds" for each task and

 

 

3 views
1 reply, 2 days ago
Create a table with a date column that has a default lenght (8) Topic by intelligence 02 Jul 2014 date format, default value, create table, YYYYMMDD

Hi All!
We can not create a table adding a column DATE that has lenght(8) using FORMAT (YYYYMMDD) and default value '00010101'.
Nir 20010101 nor 20000101 default values are not working.
currently We are running the DDL USING:
FEC_INFORMACION        DATE           FORMAT 'YYYYMMDD' NOT NULL DEFAULT DATE '0001-01-01'

572 views
3 replies, 2 days ago
Encryption in Teradata Topic by dins2k2 4 days 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

15 views
4 replies, 2 days ago
Need help in tuning a Query Topic by Lalithachintha 3 days ago

Hi All,
The below Query is facing Spool space issue while executing ...

SEL I.DLVR_POINT_NO, SUM(I.SALES) AS InvoiceAmtLast12, CAST(NULL AS DECIMAL(18,2)) AS InvoiceAmtLast24, 

CAST(NULL AS INTEGER) AS CalcGrowth FROM

VOLUME_TABLE  I

WHERE I.SETL_DT <= (add_months((CURRENT_DATE - extract(day from CURRENT_DATE)+1),0)-1)

15 views
4 replies, 2 days ago
Converting a date time Topic by jdburns2014 2 days ago

Hi - I have a date time variable in this format 6/2/2010 13:28:44.000000. I would like to drop the milliseconds so it looks like this 6/2/2010 13:28:44 but still maintained as a datetime variable.
I've tried something like this
select cast(DISPOR_DT_TM as timestamp(0) format 'MM/DD/YYYYBHH:MM:SS') as cdate
from spprthy_curr_bmt
but I get a DateTime overflow

5 views
1 reply, 2 days ago
TPT Table Load Topic by islanderman 1 week ago

We are loading large amounts of data into a table using TPT and it works fine.  I have my attr file setup to load to a certain table, but the only issue I have is that when the TPT load is successful, I cannot execute anything against the actual load table.  I have to do an Insert into an exact duplicate table and then I can execute against that one.  Is this the way others have set this up?

30 views
6 replies, 2 days ago
How to decide about Stats for new queries Topic by GianTD 2 months ago query, stats, tuning

Hello All !
 
I am bit new to Teradata and started working on it couple of months back.
 
I working on performance tuning suggestions for some new queries.
 
Wondering if anybody can help on:
How we can decide for the stats for new queries. I mean, the queries which are not in production yet.

951 views
28 replies, 2 days ago
Compare two database Tables, row count in each table which are in different servers Topic by Sunnyguy 16 Aug 2011 row count, compare databases, different servers

Hi All,
Please help me, we recently implemented new production box which is replica of old production box
now our management want to compare the tables and row count on old and new boxes for each database.
what is the best way to do this.

Is there any sql script that will pull all the tables and row count from old box first and again new box.

4664 views
5 replies, 2 days ago
Finding the nearest greater date lookup through SQL Topic by xzbitz 3 days ago teradata sql question

Hello 
I have two tables EMP and EMP_RESP,
EMP holds EMPID and the date a request was submitted by the employee
EMP_RESP holds the EMPID and the date erquest was responded

EMPID	SUBM_DT
100	4/1/2012
100	2/1/2013
100	2/8/2013
100	5/1/2014

 

8 views
2 replies, 2 days ago
Convert time '0300' in varchar format to Timestamp by appending current_date to time Topic by irf2008 3 days ago

Hi,
 I need help in converting  time '0300' (3 AM) which is  in varchar format to Timestamp(6) by appending current_date to time(2015-01-23 03:00:00)
Thanks,
 Irf
 
 
 
 
 

6 views
1 reply, 2 days ago
Disk IOs in Teradata 14.10 Topic by yiannish 3 days ago teradata, drop, IO

I am very concerned with the Disk IOs of my Teradata server.
I have ran the following query

11 views
1 reply, 3 days ago
How to specify special characters(alphabets) in WHERE clause Topic by dev1987 3 days ago Handling Special characters in WHERE clause

Hi,
I got one query where in i have to specify special characters in where clause.
Below is example.
column1 is varchar(10) and it  has multiple values like 'dettile','sÄetl','uyrtf'......
Now my requirement is to find the rows which has got column1 values like ('dettile','sÄetl').
I wrote query like below

6 views
0 replies
Transposing the columns Topic by rahulawasthi 5 days ago

hello guys,
I want to transpose few rows into columns in teradata. please help me writing the SQL.
Input-- A
           B
           C
 
Output --  A   B  C
 
. i have tried a lot but counldn't find a solution.Please reply as soon as possible.
 

25 views
3 replies, 4 days ago
Dynamic Table Name Topic by neelabi_24 4 days ago teradata, bteq, dynamic, table, name

Hi,
I have set up a BTEQ of an SQL code through PUTTY.
The code runs weekly. However, I run a drop statement and then a create table statement, thus losing the table of the previous week. Is there anyway for me to create a table of the following format so that I retain all the tables that I have created ?
CREATE TABLE TABLE_NAME_<CURRENT_DATE> AS

11 views
1 reply, 4 days ago
Replace View ( DDL ) inside a Stored Procedure Teradata Topic by Karrajan 6 days ago

Hi All,
 
Could you please let me know whether stored procedure can be created in teradata only having a replace view statement and without any parameters since we dont have any parameters.
Also guide me whether a macro having a replace view statement can used inside another macro.

19 views
3 replies, 4 days ago
Seeking ideas: need to grab next available UPI for inserts Topic by jcr9000 1 week ago

Hello,
I am a developer hoping to get some help with ideas to devise an elegant way of grabbing the next available Unique Primary Index for inserts to a table which is quite old and large that drives an ASP.Net application which I am maintaining. Details for the change I have to make are below:

150 views
8 replies, 4 days ago
DECODE uneven behavior Topic by kkreddy427 1 week ago

My session in Teradata mode. But decode by default behaving like a case specific.

any solution to avoid this.

 

SELECT CASE WHEN 'y' = 'y' THEN 'yes' ELSE 'no' END output

Result:

yes

SELECT CASE WHEN 'y' = 'Y' THEN 'yes' ELSE 'no' END output

Result:

yes

 

SELECT DECODE ('y','y','yes','no') output

Result:

13 views
2 replies, 5 days ago

Pages