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.
High Skewfactor inspite of even distribution Topic by drmkd17 3 days ago Skewfactor

Hi All,
 
Today i came across a weird scenario in Teradata. 
One of my tables dbc.table_a  was highly skewed with a skewfactor of 95.77 . I used the below query to check the skewfactor.
SELECT
TABLENAME,
SUM(CURRENTPERM) /(1024*1024) AS CURRENTPERM,
(100 - (AVG(CURRENTPERM)/MAX(CURRENTPERM)*100)) AS SKEWFACTOR
FROM
DBC.TABLESIZE

49 views
5 replies, 42 min ago
Any benefit in NUSI on "customer_type" column? Topic by dnsmkl 1 hour ago performance nusi

Hi,
Is there any point/benefit in creating secondary index on column,
which has low number of distinct values compared to size of the table.
Hypothetical example:

6 views
0 replies
Packdisk Performance Query Topic by SG255017 2 hours ago

Hi All
Is it possible to run packdisk on multiple tables at a time? If yes could you please share the steps in Ferret.(fyi...I know the steps for single table packdisk)
Please also let me know whether any performance impact due to this activity.
Thanks
Sanket 

11 views
0 replies
unix timestamp with timezone to teradata timestamp Topic by nealvenna 2 days ago

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
 
 

33 views
3 replies, 4 hours ago
NOT NULL still retrieves NULL Topic by johnsunnydew 2 days ago

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

27 views
2 replies, 19 hours ago
global parameters or variables in Teradata? Topic by cdorger 2 days ago

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)

18 views
1 reply, 20 hours ago
PRESERVING A SPACE IN A LIKE STATEMENT Topic by rnadjafi 2 days ago like

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

31 views
3 replies, 20 hours 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

3661 views
4 replies, 1 day 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

35061 views
16 replies, 2 days ago
special char 0xFF convert to 0X1A with character set LATIN1_0A Topic by blankme 2 days ago character set, LATIN1_0A

i encountered a character set problem make me headache, please someone can help me.
there is a table t_special with database sever character set 'LATIN', then i execute the sql insert into t_special (specialchar) values('FF'xc) with session character set 'LATIN1_0A'. (column specialchar is varchar(10) type).

7 views
0 replies
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 

 

1808 views
2 replies, 3 days 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...

3224 views
3 replies, 3 days ago
Transaction QUERY_BAND not working Topic by mm185159 3 days ago

Whenever I set a Transaction Query_Band, the only statement recorded in QryLog table is the SET QUERY_BAND= statement. The following SQL transaction does have the Transaction QueryBand Name/Value pair associated with it.
By Example:
SET QUERY_BAND='STEP=1.0;' FOR TRANSACTION
;insert into DBA_SANDBOX.EPIC21_gt_svc_agmt_sample_list
...
From Query Log Table:

13 views
1 reply, 3 days ago
MINUS(ALL) OR EXCEPT not detecting changes in records Topic by boagus1 3 days ago

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)

14 views
0 replies
Error 7547 on Update Topic by 31_resu 3 days ago 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.

48 views
5 replies, 3 days ago
ISOLATING A BLOCK OF TEXT FROM A LARGER BLOCK OF TEXT WITHIN 1 COLUMN Topic by rnadjafi 4 days ago

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.  

24 views
2 replies, 3 days ago
Identifying which column is throwing error on INSERT Topic by boagus1 5 days ago
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.

37 views
2 replies, 3 days ago
Stored Procedure Default Date Format Topic by jonesj2 13 Jan 2014 stored procedure, default date format

We are recompiling stored procedures and some are erroing at execution because they use a different default date format. For example: The current default date format is YYYY-MM-DD, and the SP uses a literal defined as '11/02/2012'. The SP compiles ok but errors when executed. I am assuming the default date format was changed when this SP was compiled.

1878 views
3 replies, 3 days ago
Query optimization issue Topic by lucky11dec 4 weeks ago #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.
 

45 views
2 replies, 3 days ago
Response Row size or Constant Row size overflow Topic by SAP 12 Oct 2014 Response Row size, Constant Row size overflow, Response Row size or Constant Row size overflow

Hi All ,
Please help me on the below mentioned error while just selecting a view
 
Executed as Single statement. Failed [9804 : HY000] Response Row size or Constant Row size overflow.
Elapsed time = 00:00:00.140
 
STATEMENT 1: Select Statement failed.
 
Thanks !!!
 

5552 views
8 replies, 4 days ago
how to create variable table name Topic by jhsun3 4 days ago

Hi there,

9 views
0 replies
How to query specific time Topic by openbox 4 days ago

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,

28 views
1 reply, 4 days ago
Recursive Query Vs UNION Topic by NiteshM 1 week ago Recursive query

Hi Experts,
I have below tables 

88 views
6 replies, 4 days ago
Bteq-import- Error Handling Not working Topic by Sunny445 5 days ago 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.

43 views
2 replies, 5 days ago
COLUMNAR TABLE- SELECT TOP N* FROM COLUMNAR TABLE NOT GIVING OUTPUT Topic by pushkarcse 5 days ago Columnar table

Hi,
I am facing one issue with the columnar table. I am unable to fetch records using TOP N* command from a columnar table with 256 columns.

SELECT TOP 10*

FROM COLUMNAR TABLE

--Returns no rows

 

But when I am applying filter condition, I am able to fethch records using TOP N* command,

 

SELECT TOP 10*

24 views
1 reply, 5 days ago

Pages