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.
Copy the record and increment in its one column Topic by Lacsum 9 hours ago teradata, increment column, Identity column, csum, olap, rank, rowcount, max number

Hi, 
So i've been searching all around on how i could increment a column in Teradata. I'm new to this so im not really familiar with all the syntax or tactics that i could use. 
I've read about autogenerated identity column, OLAP and recursive in teradata but i think it does not matches my need. 
So here's my problem.

45 views
3 replies, 2 hours ago
My perception on EXPLAIN was wrong Topic by cheeli 8 hours ago explain

Greetings experts,

19 views
1 reply, 2 hours ago
String contains an untranslatable character Topic by cheeli 8 hours ago untranslatable character

Greetings Experts,
I need to find out what are the columns that has any language characters other than english (unicode with other language characters in it - not dbc.columns.chartype=2)  Teradata version: 13.10
eg: tablea=> cola => unicode => the data in it is in chinese
      tableb=> colb => unicode => the data is it is in english

19 views
0 replies
Format with leading zeros Topic by Alex181 22 hours ago

Hi, I need to format the column accnt_id to get the output as result_accnt_id. Any help will be greatly appreciated. Thanks.
 
accnt_id     Result_accnt_id
1               A0000001
2               A0000002
39,000       A0039000
100,962     A0100962
 

111 views
6 replies, 17 hours ago
regexp_replace woes Topic by jnevill 01 Nov 2013 regex, regexp_replace, replace, translate, omgwtfbbq

I want to replace all of the whitespace and non alphanumeric characters in a string. It seems like some form of the following should work:

1542 views
7 replies, 19 hours ago
What's the difference between NOT IN and minus in SQL? Topic by lijianguonew 1 day ago teradata

Hello Experts:

 

What's the difference between NOT IN and minus  in SQL? 

 

Which is better to use in SQL queries for the performance aspects?

59 views
1 reply, 23 hours ago
Setting Spool Space Limit for Profiles Topic by Kishore_1 23 hours ago spool space, profiles

We are having ~1000 Business Users, who are accessing the Teradata Production system.

The business users are assigned to a common profile.We want to set a spool space limit for the business users at profile level.

How can we get the value of spool space that will enable the buiness user's queries to run smoothly.

19 views
0 replies
QUERY CHALLENGE - FIND CUSTOMERS WHO HAVE SPECIFIC PRODUCTS Topic by CCSlice 1 day ago

Hi Everyone
 
 I am trying to find a way to return client no's that exclusively have a product(s).  Let's say the product numbers are 1 and 2.   They customer can either have product_id 1 or product_id 2 or both.  Now the problem is that many customers may either of these products but also other products.  These customers have to be excluded.

71 views
3 replies, 23 hours ago
CASE Statement error please help Topic by nileshbhaw 1 day ago

Hi All,
 
While running the below query it gives me error ' Illegal expression in WHEN clause of CASE expression' . Can you please tell me what is wrong with the below code.
 
 

SEL A.*,

CASE WHEN CUST_NM = CC_Lookup and CUST_NM is not null then 

62 views
3 replies, 1 day ago
How to configure a scheduler in teradata? Topic by shivasha 1 day ago scheduler

Is there is any system table available in Teradata to hold scheduler information?
I am using weblogic server with Teradata.
Need to run in clustering mode.

31 views
1 reply, 1 day ago
Calling Stored Procedures from Dynamic SQL Statement Topic by thomas.wolf 2 days ago

Hi,
is there a way to call a stored procedure from a dynamic SQL statement? I don't know the name of the stored procedure at compile time, so I have to build the SQL command invoking the SP dynamically.
Thank you in advance,
Thomas

82 views
3 replies, 1 day ago
ROLLING 12 MONTHS Topic by cmyeyez 1 week ago

Hi.
I need the syntax to create a table or view for 12rolling months
using the system calendar (syscal).
using Teradata 13.11
 
Thanks

136 views
7 replies, 1 day ago
SQL query to understand the names of the tables , number of records in a table and size of the table Topic by krishnaprasadmt 2 days ago

Hi
Please help me with a  SQL query to understand the names of the tables , number of records in a table and size of the table ?
 
Regards,
Prasad

62 views
2 replies, 1 day ago
To find number of null values in each columns of a table Topic by jayantarout79 1 week ago count null values

Hi ,
I want to count all the null values of all the columns of a table.
SEL ColumnName  from  DBC.Columns where tablename='table_name' and DatabaseName='database_name';
The above will provide all the column names.
SEL COUNT(*)-count(col_name) from table_name;
The above will provide number of null values for one single column.

159 views
6 replies, 2 days ago
Identifying GTT or volatile tables created during a session Topic by Moutusi 2 days ago #Volatile tables, global temporary table

How can I identify what are the GTT or volatile tables created during a session?

55 views
2 replies, 2 days ago
TERADATA Regular Expression Function Topic by Jugalkishorebhatt1 2 days ago TERADATA Regular Expression Function

Hello All,
In the info.teradata.com, which document can i find regular expression Function.
 
 
Thanks
Jugal

61 views
1 reply, 2 days ago
Cursor in Dynamic SQL Topic by Sun_shine_jgd 2 weeks ago cursor processing teradata stored procedures

Hi i have a cursor which returns me the date.
Belwo is the sample

FOR Cur_Dt AS Cur CURSOR FOR

SELECT STRT_DT

FROM table

WHERE STRT_DT

BETWEEN 1900 -01  01

AND 9999 01  01

 

Now i have a dynamic SQL..

91 views
2 replies, 3 days ago
Defining two derived tables using WITH clause ?? Topic by mjasrotia 20 Mar 2012

Following is a way to define a derived table using a WITH clause in the starting of the query and using it in the query thereafter. Is there a way to define more than one derived tables using WITH clause.

 

I understand the use of VT, GT and other temp tables but still need to know if there is a way to do that using WITH clause.

 

WITH TEMP_TAB(a,b,c)

8824 views
10 replies, 3 days ago
Capacity Planning for Teradata Database Topic by prasadkool123 3 days ago capacity planning

Hi experts..
While searchin on forum for information related to capacity planning, I found this thread thaat tells about what can be done when there is existing system on ongoing basis. "http://forums.teradata.com/forum/database/capacity-planning-steps"

35 views
0 replies
Cursor processing teradata Stored procedure Topic by Alex181 3 days ago database, cursor processing teradata stored procedures

Hi, I have the code/logic (below) in Java and I need to convert this to Teradata. I am struggling with using the approprite syntax and procedures in Teradata. Your input and guidance would be greatly appreciated. Thank you.
 
public class sagun {
    public static void main(String args[]){

48 views
1 reply, 3 days ago
Capturing Procedure output parameter in BTEQ Topic by yamahaha 16 Jun 2008

Hi,Im am capturing procedure output in BTEQ and writing a file with the two output values.On is a simple message that reports activity count or an SQL error messageThe other is an exit codeegbteq <<_END_.logon $IDW_LOGONCODE.sidetitles off.foldline.titledashes off.width 256.os rm $FILE.export file $FILEcall $TGTDB.$PROCNAME('','','','','',p_return_msg,p_status);.export reset_END_Howerver if i force the procedure to fail the output parameter values are no longer get writen to the output file by BTEQ even though I set the paramaters to a value in the exception block of the stored procedure.Can anyone explain/help me on this one please?

24153 views
7 replies, 3 days ago
Rows to Column (Column-delimited) Topic by samkv 5 days ago

Hello, I would like to know how to read in the following table contents and output the data in comma-delimited format:
 
TableA contents:
Account#        Date            Amount
1234             1/3/2014           175
1234             2/4/2014           200
1234             3/6/2014           150
1234             4/3/2014           190

156 views
7 replies, 3 days ago
Determine status on a given date Topic by voleary 2 weeks ago

I have a table (status_moves) which logs each time a record changes status. It looks like this:
[db.stage_moves]

_date

account_id

old_value

new_value

5/21/2014

400

B

C

5/31/2014

400

C

A

6/1/2014

300

C

B

158 views
8 replies, 3 days ago
Procedure creation Topic by srik16 3 days ago

Hello, how do we create a Procedure and call it in Teradata? Appreciate your help please...

28 views
0 replies
Teradata to Excel copy Topic by srik16 3 days ago

hello, we have a request to copy data from Teradata table into Excel (.xlsx format), I dont want to do this from Teradata SQL Assistant, but want to do it programatically... appreciate if you help me out with a simple example please...
 
Thank you.

31 views
0 replies

Pages