#DateForumTypeThreadPost
292819 Jul 2014 @ 03:33 PDTGeneralReplyconvert 13 digit epoch time to date?This is the correct calculation, but it's based on UTC and your time zone might differ. I use these SQL UDF to convert to/from Unix time: /********** Converting Unix/POSIX time to a Timest...
292718 Jul 2014 @ 08:05 PDTDatabaseReplySorting the table in ascending orderThere's no guarantee that rows are retuned in a specific order in any DBMS without an ORDER BY. Access happens to store the data based on the PK, but in SQL Server this might change, too. 500...
292618 Jul 2014 @ 05:53 PDTDatabaseReplyFacing issue in Sybase to Teradata migration stored procsDid you read my answer at http://forums.teradata.com/forum/database/sybase-similar-function-and-teradata-14-0-equivalent#comment-134462
292518 Jul 2014 @ 05:31 PDTDatabaseReplyUSLARE in TeradataThere's no USLARE keyword in Teradata, should probably be DECLARE.
292418 Jul 2014 @ 03:08 PDTDatabaseReplySQL statement wantedHi Helmut, is there a row for every date? What if a date is missing? You need to nest OLAP functions: SELECT OUTLET_ID ,QUALITY_FLAG ,COUNT(*) ,MIN(DATE_ID) ,MAX(DATE_ID) FRO...
292317 Jul 2014 @ 02:09 PDTDatabaseReplysel cast(10**9 as int) giving wrong resultThe exponentiation operator ** results in a FLOAT, which might be the reason. In TD14 you could use POWER(10,8) instead which returns a NUMBER (and a correct result ofter the CAST). Before you co...
292217 Jul 2014 @ 01:56 PDTDatabaseReplyregexp_replace woesHi Aniket, the REGEXP_REPLACE in Aster has different arguments: regexp_replace(source, pattern, replacement [, flags ]) This should work: regexp_replace(text_with_htmltags, '<([^>])*&...
292117 Jul 2014 @ 10:35 PDTThird Party SoftwareReplyHaving an issue with my ODBC connection to Teradata within AccessWithout formatting this is hardly readable (I know it's Access). But a qualified table name looks like databasename.tablename, so it should be DL_QPT_CQE.QUALMAIN
292017 Jul 2014 @ 07:35 PDTDatabaseReplyChoosing FExp/TPump or regular Insert STMTHi Vinod, in the Database Administration manual there a chapter on Loading and Exporting Data including performance considerations: http://www.info.teradata.com/HTMLPubs/DB_TTU_14_10/Database_Man...
291917 Jul 2014 @ 07:23 PDTDatabaseReplyRelation between Database and UsersWhy all other DBMSes got similar concepts, users and databases/schemas/owners, too? Do you want to create random passwords for maybe hundreds of users which never logon?
291817 Jul 2014 @ 07:12 PDTDatabaseReplyGroup by on a Group by not working as expected!!!Hi Peter, what's the error you get, a 3504? I just tried it and all SELECTs worked  on my system :-) So the optmizer might be more clever in a newer release and notices the dependency b...
291717 Jul 2014 @ 06:44 PDTDatabaseReplyNeed Query/Procedure to concatenate multiple(n) rows into one row for a particular record dynamicallyHi Sathya, based on your example there's probably a known maximum line_num, so easiest to write is this, it's mainly cut&paste: select eid, name, max(case when line_num = 1 the...
291617 Jul 2014 @ 01:39 PDTDatabaseReplyRelation between Database and UsersAs a user is the same as a database every user can be granted access to D. E.g. every user has access to the owner of the system tables, DBC, via PUBLIC rights.   The term database is ...
291516 Jul 2014 @ 11:04 PDTDatabaseReplyHow to Query between two tables involvng timestampsWhat's the actual Primary Key of your tables? You need to add a condition like this: WHERE A.ENTITY_KEY = B.ENTITY_KEY AND DOC_TMSTMP BETWEEN LOG_TMSTMP AND LOG_TMSTMP + INTERVAL '1&...
291416 Jul 2014 @ 01:15 PDTDatabaseReplyBlank space check based on the positionOf course casting to a numeric value will fail if there are non-numeric characters in your string. If you can't use REGEX_SIMILAR you need to check each character if it's between '0...
291316 Jul 2014 @ 12:05 PDTToolsReplyFastload Problem: Invalid Fastload StatementYou can use a typecast in FastLoad, but it must be Teradata style, not CAST :-) (:dtime (TIMESTAMP(0), format 'yyyy-mm-ddbhh:mi:ss'))
291216 Jul 2014 @ 10:30 PDTDatabaseReplyUpdate date format and create timestamp columnDATE/TIME/TIMESTAMP are always stored in an internal format, what you want is to change the display format, this can be done using adding a FORMAT to the column definition and then a CAST to a VARC...
291116 Jul 2014 @ 10:24 PDTDatabaseReplyRelationships between the tablesYou already have indexes :-) If you define a PK in the Create Table Teradata will implement it as an Index, a Unique Primary Index (UPI). You can keep the PK/UPI for your other tables (which are ...
291016 Jul 2014 @ 02:38 PDTGeneralReplyQuery Aggregation & group by issueHi Pankaj, I don't know what you actually want, but this might be correct: select SUM( CASE WHEN (TRIM(col1) NOT IN ('A','B','C') AND lkp.col2='X') THEN src....
290915 Jul 2014 @ 11:27 PDTGeneralReplySELECT TOP 10 * FROM VIEW spool errorHi Robert, the view is not complex, but there's a WHERE-condition in it and that's enough to make the TOP slow :-( Both TOP and SAMPLE are always applied as last step and any WHERE/JOIN/G...
290815 Jul 2014 @ 11:23 PDTDatabaseReplyEmbedded Dynamic SQL to Execute an Update StatementHi Howard, Excel can directly access any database via ODBC using Microsoft Query: http://office.microsoft.com/en-us/excel-help/use-microsoft-query-to-retrieve-external-data-HA010099664.aspx http...
290715 Jul 2014 @ 10:57 PDTPrivate Forum
290615 Jul 2014 @ 10:19 PDTDatabaseReplyChecking for Null Values to Make ComparisonsSeems like you want to return NULL if any of the columns is NULL. As any comparison to NULL will result in UNKNOWN and the default for ELSE is NULL you might simplify it like: CASE WHEN FIELD_1 ...
290515 Jul 2014 @ 10:12 PDTPrivate Forum
290415 Jul 2014 @ 09:28 PDTDatabaseReplyEmbedded Dynamic SQL to Execute an Update StatementHi Howard, within an Excel sheet there's no need to prepare/execute, this is for Embedded SQL/Stored Procedures only. So running the update directly should work.  

Pages