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.
unix timestamp with timezone to teradata timestamp Topic by nealvenna 24 Jun 2016

Hi all, 
I have unix epcoh timestamp with timezone and it needs to be converted to teradata timestamp(6). I have tried to solve this by seeing old posts in teradata forums, but none of them are related to timezone. One of the example in the sample is 1466017810720. Kindly help.
Thanks
 
 

195 views
3 replies, 4 years ago
NOT NULL still retrieves NULL Topic by johnsunnydew 24 Jun 2016

Hi Friends,
Can somebody help me on the below issue that am facing while executing it. The result of the below query retrieves NULL value even when specified the filter IS NOT NULL.
 
SELECT VER_ID,MAX_ID
FROM RULE_TABLE
where CURRENT_TIMESTAMP > RULE_START_DT

99 views
2 replies, 4 years ago
global parameters or variables in Teradata? Topic by cdorger 24 Jun 2016

Does Teradata have global parameters or global variables?  I want to take a sample from a table where the sample size is a multiple of the number of rows in another, existing, table:

create table t2 AS(

   select top 360 *

   from t1

   )

with data primary index(keycol)

104 views
1 reply, 4 years ago
PRESERVING A SPACE IN A LIKE STATEMENT Topic by rnadjafi 24 Jun 2016 like

How do you preserve the space in a LIKE statement (% WORD1%)?  Any assistance you can provide would be greatly appreciated.
 

115 views
3 replies, 4 years ago
How to insert recursive query answerset to another table Topic by Gowtham 20 Feb 2013

Hi,
 
For a looping concept, i had done a query in recursive but i dont know how to load the result to another table,
I need your help to load the answerset to another table.
 
Thanks

3972 views
4 replies, 4 years ago
CASE statement in SQL Topic by KVB 03 Oct 2013

 
In both the cases,it is printing 'Yes' .Why??
sel
case when 111=cast('111' as char(3)) then 'yes'
else 'no'
end

sel
case when 111='111'  then 'yes'
else 'no'
end

36591 views
16 replies, 4 years ago
DBLink in Teradata Topic by cnaveen05 12 Mar 2013 DBlink, db2, Cross DataBase, database connectivity

 

Hi, 

Like oracle is there a feature in teradata where we can access tables across other databases/servers within the same connection? Specifically, I am trying to see if we can access DB2 tables directly from teradata. 

Thanks, 
Naveen 

 

2063 views
2 replies, 4 years ago
Teradata DBLink Topic by goldminer 10 Apr 2013

A question that I get from developers on a routine basis is "When is Teradata going to develop DB Links?"  As a DBA, I could use this functionality as well.  Has anyone else ever inquired about DB Links from Teradata?... if so...

3392 views
3 replies, 4 years ago
MINUS(ALL) OR EXCEPT not detecting changes in records Topic by boagus1 23 Jun 2016

I'm working on a delta load that should be straight forward.
Day1 Initial - all the qualifying rows from source, loaded into t1
Day2 Delta - all the qualifying rows from source with changes from Day1, loaded into t2
in dev, to simulate change, I modified 2 columns in t2
When I run
(Sel * from t2
MINUS(ALL) / EXCEPT
Sel * from t1)

62 views
0 replies
Error 7547 on Update Topic by 31_resu 23 Jun 2016 update 7547 spool

Hello,
I'm running an update, and as I develop it, from updating everything incorrectly, to error 7547's, to spool space, and collecting stats on tables invloved, distinct, with and without qualify row_num, I get 7547 or a spool stll. Can someone please help me with this update statement.

160 views
5 replies, 4 years ago
ISOLATING A BLOCK OF TEXT FROM A LARGER BLOCK OF TEXT WITHIN 1 COLUMN Topic by rnadjafi 22 Jun 2016

I'm a novice with SQL, but hoping someone can help.   It's for a cancer project, so you will be helping us save lives with your efforts.  Any assistance would be greatly appreciated.  

100 views
2 replies, 4 years ago
Identifying which column is throwing error on INSERT Topic by boagus1 21 Jun 2016
SEL REPAIRABLE, 'TRUE'
from T2
WHERE   REGEXP_INSTR(TRIM(REPAIRABLE ), '^[-+]?([0-9]+(\.[0-9]*)?|\.[0-9]+)$')  = 1
ORDER BY 1 DESC

3535 : A character string failed conversion to a numeric value:
 
This error has haunted my for days now and I need it resolved ASAP.

76 views
2 replies, 4 years ago
Query optimization issue Topic by lucky11dec 29 May 2016 #database #teradata #sql, #SQLAssistant, #database #teradata #explain #performance #time #tuning #DBA

Hi All, I have the given query as below. There are nested query A,B,C using same tables for joins just the entities joined are different each time. The problem is query is not optimized and does not run in database for more records. For few records gives correct result. Can somebody help me here.
 

184 views
2 replies, 4 years ago
how to create variable table name Topic by jhsun3 22 Jun 2016

Hi there,

133 views
0 replies
How to query specific time Topic by openbox 22 Jun 2016

Hi,
I'm just new in TD, need help on how to select a specific time? 
the columns look like this:

     store_id INTEGER NOT NULL,

     scan_dt DATE FORMAT 'MM/DD/YYYY' NOT NULL,

     scan_tm TIME(0) FORMAT 'hh:mi:ss' NOT NULL,

84 views
1 reply, 4 years ago
Recursive Query Vs UNION Topic by NiteshM 17 Jun 2016 Recursive query

Hi Experts,
I have below tables 

192 views
6 replies, 4 years ago
Bteq-import- Error Handling Not working Topic by Sunny445 21 Jun 2016 bteq, import, error handling, repeat

Hi, i have a bteq which uses repeat function to load a file into a table. we have a parameter for the input file. if the parameter is not available, the script is failing with a Return code 0, inspite of using the label to exit if errorcode <>0.

460 views
2 replies, 4 years ago
Reduce skew on a table with Shapefile data? Topic by teradatatester 21 Jun 2016 geospatial, skew, shapefile, primary index, index

I downloaded this Geospatial Shapefile:
https://www2.census.gov/geo/tiger/TIGER2015/UAC/
 
The table that was created by loading the shapefile looks like this:

175 views
0 replies
9804: Response Row Size/Constant Row Size overflow Topic by hyma 29 Jul 2014

I have a Query. It ran for a long time without any problem. Few days ago the query suddenly got the error: 
9804: Response Row Size or Constant Row Size overflow.
All checks that have been done just tell me that it's not really the row size that makes problem.
A DB restart didn't help.

5872 views
4 replies, 4 years ago
create mutiple tables from an existing table with while loop Topic by amoyyang 14 Jun 2016 # teradata # while # loop

This should be a common issue but cannot simply find an exact solution across forum. Thanks for hlep!
 
Here is what I need:
create table tab1 as (select * from mydata where seq=1) with data;
create table tab2 as (select * from mydata where seq=2) with data;
......
create table tab10 as (select * from mydata where seq=10) with data;
 

383 views
7 replies, 4 years ago
Error handling from DBC.SysExecSQL in my own procedure Topic by aklopis 17 Jun 2016 #STOREDPROCEDURE, #procedure

Hi!
I've got issue with error handling in my procedure
Here's some of my code:

204 views
3 replies, 4 years ago
LOBs are not allowed to be hashed issue in Recursive query Topic by johnpaul 25 Sep 2015

Hi All,
WITH RECURSIVE   my_rec(usr_nm,full_pr_num,LVL)
   AS
   (
    SELECT usr_nm,full_pr_num (clob(50000)),CAST (1 AS BIGINT)
    FROM vt_temp
    WHERE rn = 1
    UNION ALL
    SELECT  my_rec.usr_nm, TRIM(vt_temp.full_pr_num) || '|' || my_rec.full_pr_num, LVL+1
    FROM vt_temp  INNER JOIN my_rec

405 views
4 replies, 4 years ago
Dynamically select TOP N rows from table Topic by Priti_Kanal 20 Jun 2016

Hi All,
I need to perform dynamically select TOP N row from table.
SELECT TOP (10-4) COLUMNNAME
FROM DBC.COLUMNS
WHERE DATABASENAME='DATABASE_NAME'
AND TABLENAME ='TABLE_NAME';
This is because I want create 1 macro in which series of DML statements are there.
DATABASE_NAME and TABLE_NAME are parameterized.

132 views
2 replies, 4 years ago
After Insert trigger Topic by Elle 13 Dec 2011 trigger, after trigger

Hello,

 

I am trying to create the following trigger, which is almost identical to a sample one that Teradata offers in their documentation.  However, I receive the error " CREATE TRIGGER Failed. 5424:  A triggered action statement is the wrong kind. "  Can anyone tell me what is wrong with the trigger?

 

 

CREATE TRIGGER workdb.lw_gg_latency_ins

5325 views
2 replies, 4 years ago
sql create database Topic by Jhossymedina 18 Jun 2016

I would like to know how I can do a sql to create my database with permission and install the vmware version does not work so I do graphic

52 views
0 replies

Pages