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.
history handled output required Topic by sujiwarrier 1 day ago #sql

Hi ,
We have two tables with below data in given date intervals  and the output required is as single report  with its individual valid date intervals. Can anyone help on the query after joining Table A and Table B

Table A:

Cust_id   Currency   Start_date      End_date

1             USD         2014-01-01   9999-12-31

 

Table B:

80 views
5 replies, 3 hours ago
Padding a field in a select statement with spaces Topic by u156531 4 hours ago

Hi, I have a column in a select statement that needs to always result in 19 characters including spaces. It will always be populated with a different number of characters so I need to know how to pad the end with spaces after the last character. Can someone give me the syntax for this.
 Thanks

22 views
1 reply, 3 hours ago
Index on UPPER(col1) Topic by brim 8 hours ago index

I discovered last night from UseTheIndexLuke that if there's an index on col1 and an often-used query uses UPPER(col1), the index will not be used because UPPER(col1) is not the same as col1. So the author recommended to use UPPER(col1) if it's an used often on the table.

29 views
2 replies, 5 hours ago
How to execute a stored procedure from vba excel Topic by teradatauser2 2 days ago stored procedure, vba excel

Hi,

49 views
2 replies, 5 hours ago
Start dates overlap Topic by sunny.j 1 day ago dates overlap

Dears
I'm struggling to find a solution for the start dates overlap to continue with my analysis
 
unique_id     struc_name    per_id  username  start_dt  end_dt
001bbf    C10CHA00005     10225712    ?       14/10/2010    06/02/2013
001bbf2    H10CHA00002     10225712    ?      07/02/2013    08/02/2013

82 views
4 replies, 6 hours ago
FLAT SQL to SET SQL Topic by mcfabrero 14 hours ago flat sql, set sql, cursors, cursor processing teradata stored procedures

Hi All,
I need your help in converting FLAT LOGIC(Flat SQL) Stored procedure to a SET LOGIC(SET SQL). From what I understand, a Flat logic is a cursor based SQL while SET logic works on sets of data. 
I have read several examples how to convert but it just basic examples. I have this cursor which I need to eliminate but can't figure out how.
 

28 views
1 reply, 6 hours ago
TD_UNPIVOT throwing error: SELECT Failed. [9134] TD_UNPIVOT_CONTRACT; Help is confusing Topic by JerryLusa 2 days ago TD_UNPIVOT

 
 
The 14.10 help for TD_UNPIVOT has two examples, one with SELECT... FROM UNPIVOT, and another with SELECT... FROM TD_UNPIVOT.  Neither are working.
The UNPIVOT variation fails with "SELECT Failed.  [3707] Syntax error. expected something like ";" between the word UNPIVOT and '('. "

135 views
9 replies, 7 hours ago
List of all Teradata Column Types with their associated DbTypes Topic by seanc 09 Jan 2014

In parsing MetaData from various Teradata servers/databases I have run into a lack of documention that I cannot find and would love to be pointed in the right direction. In the sample database that comes with Teradata all of the columns types are either one or two characters such as "BF" or "D".

665 views
2 replies, 8 hours ago
Group by Case sensitive? Topic by rajesharra 8 hours ago group by

Hi Team,
 
Today i am surprised, one of my query is returning duplicate data. I tried to find it with the qroup by, but it didnt picked the duplicate. Excel helped me.
 
All values are same, except case difrrence in one field one has small 'r' and other has 'R'. Group by considered this as unique.
 
Is it correct?
 
thanks!
 

26 views
1 reply, 8 hours ago
Calling External Stored Procedure from EXIT Handler Topic by umarfarman 24 Jan 2012 stored procedure, teradata, exit handler, external stored procedure, sqlstate, condition handler

Problem statement:

 

We want to set custom SQLSTATE in Teradata stored procedures. The only way to set custom SQLSTATE value is through external stored procedure.

 

5333 views
1 reply, 15 hours ago
Any good Teradata Material Topic by Abhishek_Parida 22 hours ago

Any good Teradata Material

29 views
1 reply, 17 hours ago
Out of spool space on disk Topic by vickyejain 18 hours ago spool, out of spool, space

I have a situation on a productions system where our production jobs are failing with the 'Out of spool space on disk' error since yesterday. This process has been running for over a year and the data volumes being processed are consistent with the usual.

32 views
2 replies, 17 hours ago
Teradata query tunning Topic by arpit.ubale 1 day ago
explain
SELECT
  DIM_PFC_CUSTOMER_LIST_dim.DISTR_METHOD,
  DIM_PFC_CUSTOMER_LIST_dim.PFC_DESC,
  DIM_PFC_CUSTOMER_LIST_dim.KEY_ACCOUNT_DESC,
  DIM_PFC_CUSTOMER_LIST_dim.BANNER_DESC,
  DIM_PFC_CUSTOMER_LIST_dim.AREA_DESC,
  DIM_PFC_PRODUCT_dim.MANUFACTURER,
  DIM_PFC_PRODUCT_dim.BRAND_DESC,
  DIM_PFC_PRODUCT_dim.BRAND_SIZE_DESC,
  SEM_PFC_TPM.VIEW_DIM_PFC_PERIOD.YEAR_NO,
74 views
3 replies, 22 hours ago
DIFF BETWEEN PRIMARY KEY AND PRIMARY INDEX Topic by sai_666 04 Mar 2013

hI,

iam new to teradata . So please tell me the diff between primary key and primary index.

Regards,
Sai

8185 views
6 replies, 22 hours ago
Calculate Last Business Day of Previous Month Topic by Saarang84 1 day ago Last Business Day

I use the below select query to extract the last date of all completed months (current year to date) :

36 views
1 reply, 1 day ago
SQL query to understand the names of all the available tables in the database , number of records for all these tables and s Topic by krishnaprasadmt 1 month ago

Hi

Please help me with a SQL query to understand the names of all the available tables in the database , number of records for all these tables and size of all these tables ?

Regards,
Prasad

184 views
5 replies, 1 day ago
Aggregate Join Index on Complex SQL statements Topic by Raj83 6 days ago aggregate join index

Hi, I am trying to create an Aggregate Join Index with below sql..
 

CREATE JOIN INDEX PART_SALES_CUBE_AJI AS

SELECT 

COUNT(*)(FLOAT, NAMED CountStar ),

a12.ANLST_ID  ANLST_ID,

        a11.BKLG_MSR_IND  BKLG_MSR_IND,

        a12.BUYER_ID  BUYER_NM,

        a12.BUYER_ID  BUYER_NM1,

88 views
3 replies, 1 day ago
Issue : All virtual circuits are in use Topic by Sandeepyadav 5 days ago

Hi All,
 
We are facing issue “All virtual circuits are in use”. I know this issue comes when we have reached the session limit either in PE or gateway. Can anybody tell what the limit for gateway is as PE can handle 120 sessions

207 views
16 replies, 1 day ago
Load utilities Limit in TASM Topic by Sandeepyadav 6 days ago

Hi all,
 
There is limit for load utilities (fastload Mload etc) in Teradata system that is handling by MaxLoadTask parameter in DBS control. According to this we can
Increase this filed value up to 15. If we want to increase its value more than 15 then we also have to set the MAXloadAwt field

115 views
4 replies, 1 day ago
How can i find actul uncompress size of BLC Compress table Topic by Sandeepyadav 1 day ago

Hi All,
I found some BLC compress tables in my system. I want to know what is the actul uncompress table size without uncompressing these tables.
Is there way to find this.?
 
Please suggest.
 

43 views
1 reply, 1 day ago
Fallback Table Restriction in System Topic by Sandeepyadav 1 day ago

Hi All,
Can we restrict Fallback table creation in system at user level or system level.?
I mean: Is there any way so that we can restrict users to create fallback table in system ? any DBScontrol parameter ?
 
Please suggest.
 
 

29 views
0 replies
62 views
2 replies, 2 days ago
Using ARCMAIN Topic by hesham 19 May 2014 arcmain, archive, recovery
.logon 127.0.0.1/dbc,dbc;
     
ARCHIVE DATA TABLES
     (RETAIL) ALL,
     RELEASE LOCK,
     FILE=ARCHIVE;
.logoff;

Hi,
I want to archive teradata database table. I am using above script.
after executing the script. I got following error.

163 views
1 reply, 2 days ago
Volatile Tables in Macros Topic by N_Raghu 4 days ago #Volatile tables

I am writing a long macro that needed to stage data in several tables before loading into final table.

58 views
2 replies, 4 days ago
DML through multi table view Topic by spkother 4 days ago

Hi,
    I was trying to insert record into one of the base table through multi table view,it is giving error saying "View may not be used for insert/update/delete".but same insert working fine on single table view.Why?can anyone give explanation for this.
Thanks,
Sravanthi
   

60 views
2 replies, 4 days ago

Pages