#DateForumTypeThreadPost
372801 Jun 2015 @ 12:42 PDTDatabaseReplySPACE(n) as NameThere's no SPACE function in Teradata. cast('' as char(50))  
372701 Jun 2015 @ 12:41 PDTDatabaseReplyGet the date and time in yyyy-mm-dd 00:00:00 format in TERADATA SQLAs Tom Nolan already wrote: cast(current_date as timestamp)  
372601 Jun 2015 @ 12:40 PDTDatabaseReplyCollect stats taking long timeHow many stats exist for that table? Single- or multi-column? Sample stats? What's your Teradata release? How are the stats recollected, individually or at table level?
372501 Jun 2015 @ 12:39 PDTDatabaseReplyStored Procedure Graceful AbortUse SIGNAL or RESIGNAL in the outermost level without defining a handler for it.
372425 May 2015 @ 04:13 PDTDatabaseReplyTeradata valid date check without udfHow does the date look like, is there a fixed format? Leading zeroes for month and day? Any other characters before/after the date? e.g. '2015-05-15'  
372323 May 2015 @ 03:28 PDTDatabaseReplyMissing rows after join Well, the result is correct based on your join conditions FROM A LEFT JOIN T1 ON A.ID_NUM = T1.ID_NUM -- same join condition twice? LEFT JOIN T2 ON A.ID_NUM=T1.ID_NUM -- same join conditi...
372221 May 2015 @ 02:57 PDTDatabaseReplyWhat's going on with the median function in Teradata?There's a language file which determines the parsing & highlighting rules: C:\Program Files (x86)\Teradata\Client\15.00\Teradata SQL Assistant\teradata.lng
372121 May 2015 @ 03:56 PDTDatabaseReplyUsing Case statement instead of UnionHi Amit, helper is a table with numbers in it, this might be a generic on with number between 0 and whatever_max_you_need or in the above case exactly 4 rows with numbers 1,2,3,4  
372021 May 2015 @ 01:59 PDTGeneralReplyTeradata SQL No CASE because you need to work on multiple rows. If you need additional columns you can utilize ROW_NUMBER: SELECT * FROM tab QUALIFY ROW_NUMBER() OVER (PARTITION BY PID ORDER BY V...
371921 May 2015 @ 01:38 PDTGeneralReplyTeradata SQL SELECT PID, MAX(VALUE) FROM tab GROUP BY 1;  
371821 May 2015 @ 01:36 PDTGeneralReplyDifference between REPLACE VIEW and CREATE VIEWThere's no difference, REPLACE simply CREATEs the view if it doesn't exist yet.
371720 May 2015 @ 11:21 PDTDatabaseReplytrouble in creating view....Hi Yuvana, UNION does an implicit DISTINCT, try replacing it with UNION ALL (which will be more efficient, too)
371620 May 2015 @ 11:20 PDTDatabaseReplyConvert a column into a comma separated listWhat's your Teradata release? Are XML services available? SELECT * FROM dbc.FunctionsV WHERE FunctionName = 'XMLAGG'; SELECT Column_A, TRIM(TRAILING ',' FROM (XMLAGG(...
371520 May 2015 @ 11:14 PDTDatabaseReplyWhat's going on with the median function in Teradata?@Fred: MEDIAN is available in TD14.10 already :-) @Dylan: The easiest way to find out if it's a reserved keyword is to see if it fails as a column name: select 1 as median; median ---...
371420 May 2015 @ 10:42 PDTDatabaseReplyHow can I get the IndexName from Dictionary?If IndexName returns NULL there's no name. In Teradata constraints don't need names (of course it's good practice to name it) and if you don't specify a name the systen doesn't...
371320 May 2015 @ 12:39 PDTDatabaseReplySpool SpaceA database will never need/use spool space, but if a user is created as a child of this DB and the spool space is not specified, it will inherit the owner's spool space. In fact every user/dat...
371220 May 2015 @ 12:31 PDTToolsReplyPerm Space Value in BTEQ Export Report file incorrectWell, CurrentPerm is a FLOAT column and you get FLOAT as result. The default format for FLOAT is a scientific notation with exponent and mantissa, so 2.72951547622681E 002  equals 2.7295...
371119 May 2015 @ 02:58 PDTDatabaseReplyUsing WITH Statement Modifier instead of Temp Tables?Believe it or not, but the implementation of multiple WITHs in Teradata is totally wrong. There's an open DR (DR160077?) on that issue for a long time and the official workaround is to "r...
371019 May 2015 @ 01:05 PDTGeneralReplyRandom Identify Column creationThis behaviour is documented, it's not a SEQUENCE, but an IDENTITY :-) According to Standard SQL IDENTITY doesn't need to be sequential and does not have to be assigned in chronologic...
370919 May 2015 @ 11:00 PDTDatabaseReplyStored Procedure performance improvementHi Prachi, this logic can probably also be included in that CASE, it's just from another table...
370818 May 2015 @ 12:55 PDTDatabaseReplyStored Procedure performance improvementHi Prachi, yep, that's a lot of logic.  The WHILE in LAB_SVC_FTC.SP_GET_NBD assigns the next busines day, so I would start with this first. If you got a calendar (do you actually use sy...
370718 May 2015 @ 03:10 PDTDatabaseReplyJDBC queries on Teradata not logged in DBQLogTbl with parameters.What's your Teradata release? Before TD15 there's no way to get this info. In TD15 there's Begin Query Logging with PARAMINFO which logs into the new DBC.DBQLParamTbl.
370618 May 2015 @ 03:08 PDTToolsReplyMload Error - UTY3403 Only one statement per line is allowed.Simetimes those extra characters are hard to spot, might be a TAB. Some editors can show special characters, otherwise simply go to the end of the line with errors and delete anything after the sem...
370517 May 2015 @ 11:25 PDTGeneralReplyCalculate Running AveMy query returns exactly the same result as yours :-) How do you define an "active" account? To simply exclude zero amounts you might do AVG(NULLIF(Balance,0)), but this will also ...
370416 May 2015 @ 04:47 PDTGeneralReplyCalculate Running AveYou already got the month in PARTITION BY, so it already starts with the 1st of month, no additional logic needed. Plus there's no MONTH function in Teradata SQL (this is ODBC syntax) AVG(Ba...

Pages