0 - 48 of 48 tags for #teradata

SQLAlchemy

SQLAlchemy is an open source python library which provides an abstraction over relational databases making them easier to work with. It provides a SQL expression language to generate SQL queries and has an object relational mapper that allows you to express database queries in terms of classes and relationships between them. Using SQLAlchemy has several advantages:

(1) Write generic python code to work across different database backends.
(2) Interact with the database through python objects instead of writing SQL.
(3) Expose data to powerful python libraries.
(4) It can support the features of the underlying database.
(5) It's free.
 

My main objective is to transfer data from teradata to hadoop. TPT is the fastest way of doing this (eventhough i have confusion between TDCH and TPT which one to go for).  TPT 15.0 onwards supports direct export to hdfs as i read in one of the documentation and also on one of the forums.

i am using Terdata version 13.10 and R Studio 3.2.3 (32-bit). I am trying to establish connection between both using following code. I also have all required JDBC drivers installed on system.

It appears there are two evaluation versions of Teradata:
Teradata Virtual Machine Community Edition.

I get the Error 2616 (Numeric overflow occurred duing computation) when I run the code below.  I developed 2 separate queries that each run.  When I put them in one query and use a UNION I get the error message.  1 side of the union returns 274 records and the other side returns 277 records.  I'm using Teradata SQL Assistant when I get this message.  We a

Hi, i am trying to query all the data from my table in batches, e.g i have 10000 rows that i want to collect by 10 callls to db, each one will bring 1000 rows. so i will end up with 10000 rows, without duplications and row missing. i dont have any uniqe index or column in this table. 

In Teradata Studio, when executing a REPLACE PROCEDURE statement with a comment (block /* */or single-line --) above the statement, I receive the error "REPLACE  failed.  Failed [3706 : 42000] Syntax error: Invalid  SQL Statement." Below is an example that fails but if you remove the "-- comment" line it is successful.

I inherited the code below and am trying to add 2 new fields to the results (bolded below).  The code I'm using to join is also bolded below.  I'm sure it is something I'm dong that is causing me to get the following error message when I run this sql.  The error message says: Select failed 3810 Column / Paramete rfs_rv.pft.paymt_mdia_proc_sys_cde does not

Hi,
I am unable to get the intended result table.
I have the following table:
ORDERSERIALNO     USERID       PRODSKU         PRODUCTTABLE       NETREVENUE     ORDERPLACEDTIME          
123-345                   123            PHOTO01           CARDS                            44                  31OCT2010                  

I have 3 prompts in my report: (1) Group Number, (2) State, and (3) Branches. The user selects the group number (1) and the prompt for State (2) is updated with all of the states the group does business in. Then the user selects either "null" or one of the states from the state prompt (2).

I have below data in my table:

Hi All,
I am new to Teradata. I am facing an issue while trying to load to the same TD target table from multiple staging tables simultaneously. I searched the net but got confusing inputs. Please help me clarify what my options are regarding the following. We are using TD 15.

Hi,
 
I have been struggling with the below scenario and could not able to figure out the best solution for this.
Let say , i have an insert statement which is selecting data from permanent table A and inserting into Volatile Table vt_B and i have encountered a data issue while inserting the data.
 

Hello All..
Greetings of the day..
 
I have a doubt regarding connecting to multiple TD servers.
Till date I have done my works in a particular server, now I need to be involved in 2 servers. Below is the scenario, Would need little bit guidance here.
Server-1 IP: A.A.A.50   Server-2 IP: A.A.A.100

Hi Can anyone help me in solving this.....
 
Actually the code goes like this
sel
case when  division like '%REGION%' then division  else division || ' ' || 'REGION' end REGION_NAME,
Nodes,
SgSpeed,
SgUtil,
PortCount,
CAST(WeekEndingDate as DATE) WEEKENDINGDATE
from
 

Hi
Can any one help me in solving this. In a table for the columns Division and Node , I have the data like this right now
Division                                 Node

West                     RMACA-RMACB-RMACC-RMACD

Central                  PO63A-PO63B-PO63C-PO63D

 

 

But i need like this

What  all are possible ways to get the exact output mentioned below: start and endtime is timestamp fields ... In the final output starttime should take from status A and end time should take from status C .
Please help me
TAble A contains:
Name Status Start time and end time
A0001 A         08:00              08:10

I have a table AAA  which has 3 columns as Month_No,Year_No and Profit.
I want to select next 15 months profit data along with month and year from table AAA.
Can anyone help me to form the teradata Query for this?
Example:
Table Name:AAA
Month_No      Year_No    Profit
2                     2011       10

I have a query that is using Table1 and Table2 with left outer join on 'usage'. Now I have to join that query
with the Table3 with (I guess recursive sql) to generate the 'Resulting table'.
I saw lot of examples on recursive sql, but didnt find any thing that is using left outer join.
Now my existing query is like this

Hello Experts:
what is mean by NO CONFIDENCE in teradata

In the Explain plan of query:
The size of Spool 1 is estimated with no confidence to be 2,430,428 rows

Hi,
I am stuck with a query from hours. I have a situation where I need to get multiple values from a subquery with a join in the main table. 
Below is my query. 
 
Select Employee Id, Department, Division ,
(If Department = 'ABC' Then

Hi 
I have two timestamp fields which i'm using in joining condition but values are slight different in it like below.
Posting Date   : value(2014-01-09 00:00:00)
Eff_from          : value(2014-01-09 15:08:29.000000)

Teradata Online Training By Keen Technologies.We are Best Institute for Online Training and we have Expert trainers to share knowledge on Teradata. Terada course materials,videos are designed by our trainers.we
 
Should you require any further information please do not hesitate to contact us

I am new in the field of data warehousing  and have basic understanding of SQL.I want to know,What are the career fields in Teradata for those who have basic understanding of SQL and data warehousing?I want a detail answer from them who really have been in the industry for several years.
 
Thanks

Dear Experts,
How to find AMP number using Row-Hash value. I have gone through something in a blog. Below one is the link.
http://www.teradatatech.com/?p=470

I have a table tab1 with structure as-

    columnName | datatype
          col1 | VARCHAR  
          col2 | VARCHAR
          col3 | VARCHAR
          col4 | VARCHAR
          col5 | VARCHAR

 and sample data as

Hello everyone,
 I need to get the week of the year from a date, but 1st of Jan being the 1st week. (no matter what day it falls on). How can I get this in Teradata sql? For eg. 6 Jan 2013 is week 2.  Can someone please help?
Thank you so much.
San

 

Hi,
I need some help with some code below; I'm relatively new to Teradata SQL Assistant (vs: 13) - sample data below:
Customer   Number      Date         Time           Seq         Agent            Phone         Update Date            Last Call             Last Time

Numeric overflow computation error
Max (col1) = 11478000.0000
select cast (max(col1)*123.000*12300.00 as decimal( 15,5 )) from table1
Also if we do normal select also not working
select (11478000.0000*123.000*12300.00 )
Please help me on this
 

I seem to be having trouble with a query that I inherited from another developer.  I'm told this is running a 99% skew. Would anybody be able to tell me what looks so skewed about this table?
 
create table ntl_prd_qmtmptbls.calls_tz_cw as (
select
cust_id,
cust_line_seq_id,
acss_call_dt,
call_start_tm,

Can following query be rewritten so it does not have to use UNION ?  THANKS.
 
SELECT 1 AS FCST_MONTH_KEY, SUM(s.MDU_Plan), SUM(s.Bulk_Plan), SUM(s.DTH_Plan), SUM(s.CP_Plan), SUM(s.D2_Lite_Plan), SUM(s.UNKNOWNPLAN)

FROM 

HI all,
 
I am a new bee in TD and I am facing an issue. The details are given below.
 
I am trying the below query, here I am trying to INSERT rows into a table and ROLLBACK...
 
BT;INSERT INTO TABLEA SELECT COL1,COL2,COL3 from TABLEB; ET;ROLLBACK;
 

Hi ,
My requirement is : I have to insert data from excel sheet to teradata tabels without using olap connector and import/export option thats available in TD.
 
Is this possible, if so could you please help on this?

hi
 
i am trying to write a bteq script which executes some select statements and exports the result to a text file on my system running on windows
here is the script
 
 .logtable SAMPLES.bteqexportLog;
.LOGON 127.0.0.1/tduser,tduser;
.begin export sessions 20;

Hi,

 

I'm new to Teradata,working in Teradata to Oracle migration project, converting Teradata DDL to Oracle.

 

For UNIQUE PRIMARY INDEX ( TRSY_ID,TRSY_STM,TAX_ID ): converted like below

 

TRSY_ID as Primary key , TRSY_STM as not null Unique , TAX_ID as not null Unique.

 

Hi all,
I want to Export 3 TB of data from Teradata in flat file or in other format. Please help me with the best resolution for the same. We tried using Fast Export but it takes longer time. Please share your views along with the time estimate for Exporting 3 TB of data.
 
 

SEL  CAD.CUST_ACCT_KEY, CATD.CUST_ACCT_MKT_DESC,  CASD.CUST_ACCT_STAT_CODE, ETD.RCVR_TYPE_DESC, ETD.EQUIP_BUS_CAT_DESC  

 

FROM CUST_ACCT_DIM AS CAD

  JOIN CUST_ACCT_STAT_DIM AS CASD 

     ON CAD.CURR_CUST_ACCT_STAT_KEY = CASD.CUST_ACCT_STAT_KEY

     

  JOIN CUST_ACCT_TYPE_DIM AS CATD 

The following query gives the higest #number count per day, which is 7 rows each for 1 day. I want to include HOURS column to the results set with changing the resulting result set.So I want to know at which hour the count was the highest? without listing all the hours. Is it possiable?

 

result should be as this:

 

how can I merge these two sql in to one query?

 

SELECT MONTH_BGN_DATE 

 FROM MONTHDAY_DIM 

 WHERE MONTHDAY_KEY = ADD_MONTHS(DATE , -4)) 

 

 SELECT  MONTH_END_DATE 

 FROM MONTHDAY_DIM WHERE 

 MONTHDAY_KEY = ADD_MONTHS(DATE , -3)) 

 

thanks.

 

How can I rewrite following query to avoid join condition like this :
AND SOM2.Address = SOM.ADDR_LINE1 || ' ' || ADDR_LINE2 ||' ' || CITY || ' ' || STATE || ' ' || ZIP_CODE
 
Query:

SEL 

SOM.CUST_ACCT_KEY, 

ORD_ID, 

EQUIPDESC,

SHIP_METH_DESC, 

D_DESC, 

SITE, 

How can I translate this loop into Teradata SQL?
 

DECLARE @logdate DATETIME  

DECLARE @hrinput1 INTEGER

DECLARE @hrinput2 INTEGER

SET @logdate = '2013-03-01' 

SET @hrinput1 = '0'

SET @hrinput2 = '1'

 

while @logdate <= '2013-04-01' 

BEGIN 

How can I translate the following ms sql to Teradat Stored Procedure?
 

DECLARE @logdate DATETIME  

DECLARE @hrinput1 INTEGER

DECLARE @hrinput2 INTEGER

SET @logdate = '2013-03-01' 

SET @hrinput1 = '0'

SET @hrinput2 = '1'

 

while @logdate <= '2013-04-01' 

BEGIN 

Teradata ( Dev + Admin ) DEMO CLASS on Saturday, 25 May at 8:00 AM IST
 

I am trying to filter transactions that are less than 5 minutes apart.  In trying to develop this filter, I keep running into error messages.  The two columns I need to find the difference for are TIME datatypes:
(SEC.CALL_START_TM-PRI.CALL_END_TM) AS TIME_DIFF

Hello,
 
I have some code that I wrote that joins 2 separate tables:
 
SELECT
A.*,
B.MTN_1
 
FROM
TABLE_1 AS A
 
JOIN
TABLE_2 AS B
ON A.ACCT_NUM=B.ACCT_NUM
 
WHERE A.MTN=B.MTN_1