teradata

Can you recommend a good source for Teradata Best Practices?

Looks like my data warehouse project is moving to Teradata next year (from SQL Server 2005). I'm looking for resources about best practices on Teradata - from limitations of its SQL dialect to idioms and conventions for getting queries to perform well - particularly if they highlight things which are significantly different from SQL Ser...

Teradata Linked Server in SQL 2005

I am trying to connect to Teradata using a Linked Server in SQL Server 2005. When I try to use SQL Server to connect using OPENQUERY, I get the following errors: Msg 7399, Level 16, State 1, Line 1 The OLE DB provider "TDOLEDB.1" for linked server "TERADATA" reported an error. Access denied. Msg 7350, Level 16, State 2, Line 1 Cannot g...

How to convert string to binary in Teradata?

I don't find any functions to convert string to binary in Teradata Database manual-SQL Reference -Functions and Operators. Cast string to byte does not work too. SELECT C1, C2 FROM table WHERE C1 < (cast( ('QREPI.\k'||'00'XC||'00'XC||'00'XC||'00'XC||'00' XC||'00'XC||'00'XC||'00'XC||'00'XC||'00'XC||'00'XC||'00'XC||'00'XC||' ..') as byt...

Add a sequential number on create / insert - Teradata

In oracle we would use rownum on the select as we created this table. Now in teradata, I can't seem to get it to work. There isn't a column that I can sort on and have unique values (lots of duplication) unless I use 3 columns together. The old way would be something like, create table temp1 as select rownum as insert_num, ...

Good Resources for Teradata & Business Objects?

Can any one suggest good resources and practice exercises for Teradata and Business Objects and their combination. I have no idea on where to start..I am aware of SQL, database concepts and programming languages like c, php, c++, C#. I need to learn teradata, BO practically. I need to develop applications for reporting data from Teradata...

Teradata and SAS with BigInt's

We have a teradata database that is filled with BIGINT datatypes. SAS is the primary analytic engine for the organization. The SAS access library chokes on BIGINT and therefore forces all code to cast variables into a integer or decimal before returning them to SAS. Example: proc sql; connect to database (blah blah); create table sas_da...

How to SELECT sum of numbers less than 30 and sum of numbers greater than 30?

I'm trying to write a SELECT statement to select the sum of field but I want to return the sum of numbers less than 30 and also the sum of numbers greater than 30. I realize I can do this with two selects joined together, but I was hoping to find a "neat" way of doing it. ...

Teradata locks - How to know if a table is locked ?

Is there a way to know if a table is locked and what kind of lock is currently on a table? I was hoping for something through the DBC tables in teradata, but I can't find any reference to anything like this. I have normal user access and the DBA is no help. Thanks. ...

Loading data from SAS to Teradata - When is it ready?

When loading tables from SAS to Teradata, SAS loads the data (usually using the FASTLOAD facility) and then continues down the script. However, I often get critical errors because SAS says the data is loaded, but Teradata is still assembling the data within the table. So the data is in the database, but not ready to be used. I have yet...

How to import data from excel file to Teradata table using BTEQ scripts?

Hi gurus, I was able to do fill tables with data from Excel file or text files using GUI utility Teradata Sql assistant. But now I have a requirement to import data into teradata tables from excel file using a bteq script. I have been trying to do that using .IMPORT REPORT .IMPORT DATA .IMPORT VARTEXT and I have tried other things also,...

How to import data into teradata tables from an excel file using BTEQ import???

Hi, Im trying to import data into tables from a file using BTEQ import. im facing weird errors while doing this Like: if im using text file as input data file with ',' as delimiter as filed seperator im getting the error as below: *** Failure 2673 The source parcel length does not match data that was defined. or if im using EXCEL f...

SQL SELECT multi-columns INTO multi-variable

I'm converting SQL from Teradata to SQL Server in Teradata, they have the format SELECT col1, col2 FROM table1 INTO @variable1, @variable2 In SQL Server, I found SET @variable1 = ( SELECT col1 FROM table1 ); That only allows a single column/variable per statement. How to assign 2 or more variables using a single SELECT statemen...

Problems using REXX to access both Teradata output and DB2 output

I have a REXX job that needs to read from both Teradata (using BTEQ) and DB2. At present, I can get it to either read from Teradata or DB2, but not both. When I try to read from both, the Teradata one (which runs first) works fine but the DB2 read gives an error of RC(1) upon attempting to open the cursor. Code to read from Teradata (by...

How to insert data from an excel sheet into a database table??

Hi, I need to insert the data from an excel sheet into a teradata table. and I need this to be done using a MACRO. I have data in an excel sheet like COL1 COL2 COL3 COL4 1 2 3 4 2 5 8 10 . . so on and i need to keep a button in the excel sheet and assign a macro to that button so that when i click the button...

what is the SQL to display a number (200909) as Sep 2009 in Teradata 12

what is the SQL to display a number (200909) as Sep 2009 in Teradata 12 ...

What is the difference between GROUP BY and DISTINCT?

HI.. I have the table with the following data empid empname deptid address aa76 John 6 34567 aa75 rob 4 23456 aa71 smith 3 12345 aa74 dave 2 12345 a77 blake 2 12345 aa73 andrew 3 12345 aa90 sam 1 12345 aa72 will 6 34567 aa70 ra...

Get max of two dates from two different tables in teradata - scenario?

I have two tables table1 and table2. Table2 is having less number of rows than table1. In these two tables there are two date columns caldate1 in table1 and caldate2 in table2. So now I need to join on these two tables and get the maximum of the two date columns and keep that in new table. But if we inner join on these two tables the tab...

Netezza, Teradata, DB2 Parallel/Enterprise, ... versus Hadoop or others?

I'm looking at building some data warehousing/querying infrastructure, right now on top of Map/Reduce solutions like Hadoop. However, it strikes me that all the M/R work is just repeating what the RDBMS guys have solved for the last 20 years with parallel SQL databases. Parallel SQL implementations scale reads and writes across nodes, j...

Updating a database from an Excel speadsheet in .NET

Can Teradata tables be updated in an VB.NET application by reading an Excel spreadsheet and pulling certain values from certain columns? If so how? Thanks ...

PDO PHP query against Teradata using ODBC connect string returns no data from 5th column onwards

I'm using PDO to extract data from Teradata, using an ODBC connect string. The query returns the correct number of rows but column 5 onwards is blank (as compared to using the same query with the PHP ODBC library) Column 5 happens to be a varchar(400) field and I've read that PDO had bugs in the past with varchar columns > 255 in lengt...