teradata

Problem reading special characters from teradata - JDBC

I use teradata and the below query outputs "Altlüd" when run using a teradata client. select name as name from MYTABLE where selector=? Whereas, I get "Altl?d" as the output when I try to execute the query using a java client(jdbc with teradata drivers). I am using "UTF-8" charset and I have also tried Latin charset with no luck. I ...

sql macro parameter

This is on Teradata specifically, but in general, is it possible for a macro to accept a list as a parameter? E.g., create macro myMacro ( incomingList ) AS ( select foo from tBar where animal in (:incomingList ); ); ...and then... exec myMacro( ('chicken','pig','cow') ); ...

JDBC reconnect problems with Teradata driver using Spring and Apache DataSource

I'm using the Apache BasicDataSource for both commons DBCP and connection pool: org.apache.commons.dbcp.BasicDataSource and managing it through Spring: org.springframework.jdbc.datasource.DataSourceTransactionManager While using this combination with the Teradata JDBC driver if my database goes down or there is a network glitch I r...

Parse/deconstruct SQL with VBA-Access

Does anyone know of a way to deconstruct a SQL statement (take a select SQL statement, extract columns from each SELECT, tables from each FOR and each JOIN, and filtering criteria from each WHERE. I can then put this data into a BOM table to create a "map" of the query), including subqueries, using VBA? I have a project to map Teradata v...

how to filter teradata help table

hi all, I'd like to create a table out of the dataset generated by teradata's "help table" function so i can add some more information about the table, and be able to filter the rows by conditions. the table has 400+ columns, so this would be very convenient for management. I'd like to be able to do something similar to creating a tabl...

Teradata Optimizer Equal vs Like in SQL

I am currently trying to optimize some bobj reports where our backend is Teradata. The Teradata optimizer seems very finicky and I was wondering if anyone has come up with a solution or a workaround to get the optimizer to treat likes in a similar regard to equals. My issue is that we allow the user to input one of two methods: 1. Ente...

Teradata - Invalid Date supplied for FIELD

Hi all, I'm trying to query a table that has a varchar(100) "VALUE" column. This column can hold anything from a letter, a number or, in this case, a date. The date will always be entered in the table as 'YYYY-mm-dd'. However, when I run the following query: select * from myTable where VALUE = '2009-12-11' (Date, Format 'yyyy-mm-dd')...

COALESCE vs IS NOT NULL performance on checking empty string

Some articles I found on the internet compared ISNULL with COALESCE, so I think my question is a little different. I'm wondering which is better in terms of performance? SELECT * FROM mytable WHERE mycolumn IS NOT NULL AND mycolumn <> ''; Or SELECT * FROM mytable WHERE COALESCE(mycolumn,'') <> ''; Other than performance, are there...

WHERE and JOIN order of operation

My question is similar to this http://stackoverflow.com/questions/879893/sql-order-of-operations but with a little twist, so I think it's fair to ask. I'm using Teradata. And I have 2 tables: table1, table2. table1 has only an id column. table2 has the following columns: id, val I might be wrong but I think these two statements give...

.Net Data Access integration with Teradata 12.0

Hello I have am working on a .net application that integrates with a Teradata database version 12. Currently, we are using Odbc at the DAL to interface with the database. Teradata have come out with the .Net Managed provider recently. I was wondering if there are any performance benchmarks available to compare ODBC with the .Net Manag...

Dynamic "SELECT TOP :paramter" in Teradata Macro

Hi there, I need to alter a macro the way that a parameter can be passed to control the max size of the result set. My idea was this SQL: REPLACE MACRO myMacro ( maxRows INTEGER DEFAULT 100 ) AS ( SELECT TOP :maxRows FROM myTable; ); But all I get is the message: [SQLState 42000] Syntax error,Expected something like an I...