teradata

Teradata equivalent of persisted computed column (in SQL Server)

We have a few tables with persisted computed columns in SQL Server. Is there an equivalent of this in Teradata? And, if so, what is the syntax and are there any limitations? The particular computed columns I am looking at conform some account numbers by removing leading zeros - an index is also created on this conformed account number...

java.sql.SQLException: [NCR][Teradata JDBC Driver]: addBatch not supported

Hi, i am getting this(java.sql.SQLException: [NCR][Teradata JDBC Driver]: addBatch not supported) error while trying to execute a query in my application. i am using addBatch with preparedstatement for constructing the statement and using executeBatch for executing the query. Cant we use addBatch with preparedStatement for Teradata DB...

Early (or re-ordered) re-use of derived columns in a query - is this valid ANSI SQL?

Is this valid ANSI SQL?: SELECT 1 AS X ,2 * X AS Y ,3 * Y AS Z Because Teradata (12) can do this, as well as this (yes, crazy isn't it): SELECT 3 * Y AS Z ,2 * X AS Y ,1 AS X But SQL Server 2005 requires something like this: SELECT X ,Y ,3 * Y AS Z FROM ( SELECT X ...

Best way to compare contents of two tables in Teradata?

When you need to compare two tables to see what the differences are, are there any tools or shortcuts you use, or do you handcode the SQL to compare the two tables? Basically the core features of a product like Red Gate SQL Data Compare (schemas for my tables typically always match). Background: In my SQL Server environment, I created ...

Best way to produce automated exports in tab-delimited form from Teradata?

I would like to be able to produce a file by running a command or batch which basically exports a table or view (SELECT * FROM tbl), in text form (default conversions to text for dates, numbers, etc are fine), tab-delimited, with NULLs being converted to empty field (i.e. a NULL colum would have no space between tab characters, with appr...

dbo in SqlServer

I'm converting database from Teradata to SqlServer. I've noticed all tables and procedures are named by the prefix "dbo." (e.g. "dbo.Table1"). I would like to know if and how I can get rid of "dbo" because it would make the conversion task a lot more easier. ...

Teradata group by time interval

Can anyonen help with Teradata? I want to create a query that is a standard select count(*) from Table where Column = Something but has a group by time period done by 5 minute time intervals the time column is in 'Time' format any idea? ...

How to use variables in Teradata SQL Macros

Hello I'm wanting to use variables inside my macro SQL on Teradata. I thought I could do something like the following: REPLACE MACRO DbName.MyMacro ( MacroNm VARCHAR(50) ) AS ( /* Variable to store last time the macro was run */ DECLARE V_LAST_RUN_DATE TIMESTAMP; /* Get last run date and store in V_LA...

Teradata Change data capture

Folks, We are thinking about developing a real time application (a bunch of charts, gauges etc) reading from the database. At the backend we have a high volume Teradata database.We expect some other applications to be constantly feeding in data into this database. Now we are wondering about how to feed in the changes from the database ...

Connecting to Teradata via PHP

We need to access a Teradata database via php application We don't have odbc (unixodbc etc) on the server. How might one go about connecting to a teradata database quickly. Keep in mind - this app needs to be as portable as possible. ...

Teradata SQL: select a literal

I want to use a list of arbitrary numbers as a sort of input to a select. Option A, of course, is to create a temporary table that contains just the values (e.g., 1,2,3). I hope that you folks know what Option >A is. Suppose the statement is like: select Fx, XXXXXX as Foo from MyTable where MyTest depends on each XXXXXX So if I cou...

MAX() and MAX() OVER PARTITION BY produces error 3504 in Teradata Query

I am trying to produce a results table with the last completed course date for each course code, as well as the last completed course code overall for each employee. Below is my query: SELECT employee_number, MAX(course_completion_date) OVER (PARTITION BY course_code) AS max_course_date, MAX(course_completion_d...

Using TeraData for not so big applications

Few months back I saw TeraData Express Edition. I have no idea of this beast. I want to know whether it still comes with Express Edition and whether it is a good idea to use this database for Windows based mid-sized apps. ...

how to update rows by a range of dates in teradata

Hi, I have two tables in a teradata database that look like this accounts account_number integer date_updated_last datetime delinquency_code varchar(3) payments account_number integer statement_date datetime delinquency_code varchar(3) the delinquency code column is populated in accounts, but is not populated in payments. I would li...

nth result in Teradata result

I'm trying to make a Teradata SQL query that will return the n-th chronological visit date for each user. E.g., user | visit_date --------------------- a 1/1 b 1/10 c 1/20 a 1/3 a 1/4 b 1/5 c 1/15 b 1/9 > magic_query_for_Second_visit; user | second ------------------ ...

SQL: have a CTE be just literals

This is in teradata. For many good reasons, I would like to have a something like the below, where I start by making a CTE that just has a list of literals, and then can refer to it in later statements: with MyList(num) as( 'a','b','c','d' ) select foo from mytable where x in ( select(num) from MyList)) This is a very contrived ...

SQL: case-when statement with "exists"

I'd like to be able to set add a field that answers the question "For a value in this record, does that value meet some condition in another table?". I thought I'd try a case-when with an exists, but Teradata (my dbms) does not like it. Any recommendations? select foo, (case when exists (select x.foo from some...

Teradata FastLoad Inmod Compilation on Windows or Unix

Hi, I have an inmod for processing one file records and eliminate some unwanted rows and then feed the records to fastload utility. But I am not able to find a correct way to compile it and use it. I have GCC (GNU C Compiler) and TCC (Tiny C Compiler) on my windows macine and I got Fastload utility also installed. I tried to compile the...

how do i filter out non-numeric values in a text field in teradata?

hello all, I have a teradata table with about 10 million records in it, that stores a numeric id field as a varchar. i need to transfer the values in this field to a bigint column in another table, but i can't simply say cast(id_field as bigint) because i get an invalid character error. looking through the values, i find that there co...

Switch from Web programming to data warehousing? Should I?

I was looking a report on internet that data warehousing is much lucrative and highly paid IT career. I am talking about technologies like abinitio etl datastage teradata. I work in ASP.net and sql server 05. Is it a good thought to move from web programming to data warehousing technologies. Since I would have no experience with data war...