#DateForumTypeThreadPost
410304 Jan 2016 @ 02:58 PSTDatabaseReplySyntax of hierarchy queryNo need for recursion: SELECT log_id, url_id, dat_begin, MAX(dat_begin) -- previous row's dat_begin OVER (PARTITION BY log_id ORDER BY dat_begin DESC ROWS BETWEEN...
410204 Jan 2016 @ 08:39 PSTToolsReplyProblem with Fast Load scriptYou don't need FastLoad as the source is an existing table. Simply use a SQL Insert/Select instead: DROP TABLE XXXXXX.YYYYYY; CREATE MULTISET TABLE XXXXXX.YYYYYY, NO FALLBACK , ...
410104 Jan 2016 @ 04:23 PSTDatabaseReplyNeed help to implement the logicChandra's query plus HAVING MIN(priority) <> MAX(priority)  
410029 Dec 2015 @ 09:12 PSTDatabaseReplyHow to write (CURRENT DATE - 1 YEAR) in teradata?Hi Ghalia, wait for '2016-02-29' and you'll see why ADD_MONTHS(CURRENT_DATE, 12) is much better.
409929 Dec 2015 @ 09:11 PSTDatabaseReplyLEFT OUTER JOIN ERRORHi Galia, this syntax-variation (JOIN-(JOIN-(JOIN-ON)-ON)-ON) is hardly used, because the first table is joined in the last ON. Better switch to ((JOIN-ON)-JOIN-ON): SELECT * FROM user11__e...
409826 Dec 2015 @ 04:06 PSTDatabaseReplyMerge Statement Roll back data for RI Violation- BTEQReferential Integrity errors are recorded in the Error Table, but always cause a rollback: When the system encounters USI or RI errors (or both) in the MERGE operation, the following events occ...
409726 Dec 2015 @ 03:59 PSTGeneralReplyUnable to Convert to date formatThere's obviously some bad data. Check if year/month/day is out of range: SELECT MIN(FIRST_MISC_DATE / 100) ,MAX(FIRST_MISC_DATE / 100) ,MIN(FIRST_MISC_DATE MOD 100) ,MA...
409622 Dec 2015 @ 02:03 PSTDatabaseReplyView based on two tables This will not work, as a row must be inserted into Employee before it can be inserted into Sales. It's a wrong approach, this should be done during ETL.
409522 Dec 2015 @ 12:14 PSTGeneralReplyExport BIGINT with signed value to a fileMissing sign :-) (BIGINT , FORMAT '-(15)9') (CHAR(16)) for up to 15 digits. Btw, BIGINT stores up to 19 digits, the default format is '-(19)9'
409422 Dec 2015 @ 12:07 PSTDatabaseReplyView based on two tables MERGE can't be used to process two tables at the same time.
409322 Dec 2015 @ 11:51 PSTDatabaseReplyView based on two tables "populated into Employee table" = aggregation? Sales tables tend to be large with billions of rows, maintaining denormalized data will be a huge overhead. An Aggregate Join Index might h...
409222 Dec 2015 @ 10:37 PSTDatabaseReplyView based on two tables Of course there are Triggers, but they're hardly used in a DWH, this is usually done as a part of the loading process. What exactly do you want to achieve?
409122 Dec 2015 @ 10:34 PSTGeneralReplyExport BIGINT with signed value to a fileHow did you export the BIGINT, as a string? Check the FORMAT, maybe you simply omited the sign.
409022 Dec 2015 @ 10:31 PSTDatabaseReplyWhy are there different system views w/ same name but different suffixesViews without V/VX are deprecated (and no longer maintained) since TD12 because they're based on the old LATIN Data Dictionary.  There's is detailed explanation in the Data Dictionary...
408922 Dec 2015 @ 10:25 PSTDatabaseReplyanswer dbc.tablesAccessCount will be NULL if it's not (or was never) collected, it's zero when the count was reset using one of the dbc.Clear???UseCount macros.
408822 Dec 2015 @ 10:05 PSTDatabaseReplyHow to execute a macro within a macro You can't do this in a macro, you need a Stored Procedure.
408722 Dec 2015 @ 10:02 PSTDatabaseReplyView based on two tables You can't insert in a View with joins (at least in Teradata) and there's no workaround (there are no Instead Of triggers).
408622 Dec 2015 @ 10:01 PSTGeneralReplyHow the data is stored in Volatile tables....Hi Bharath, rows are stored exactly the same in both Volatile and "normal" tables, only the space differs, PERM vs. SPOOL.
408522 Dec 2015 @ 09:55 PSTGeneralReplyMLINREG - composable from SUM and COUNTHi Anushree, MLINREG uses a least squares linear regression, which can be rewritten using INTERCEPT and SLOPE: MLINREG(valcol,n,sortcol) REGR_SLOPE(sortcol,valcol) OVER (PARTITION BY items...
408419 Dec 2015 @ 07:29 PSTDatabaseReplyqualify rank() over (partition.....questionHi Harsh, you need to partiton by year/month and order by date like QUALIFY ROW_NUMBER() OVER (PARTITION BY EXTRACT(YEAR FROM datecol), EXTRACT(MONTH FROM ...
408315 Dec 2015 @ 10:42 PSTDatabaseReplyLeft Join check for Nulls not workingThis is not a Teradata-specific issue, SQL Server will return exactly the same result, as it's based on Standard SQL :)   You'll find a nice case study on the where-to-place-conditio...
408215 Dec 2015 @ 04:13 PSTDatabaseReplyHow to Round Timestamp(6) to nearest hourTeradata supports Oracle's TRUNC on dates since TD14.10, but only partially. TRUNC(current_timestamp, 'HH') is valid syntax, but the resulting datatypa is always a DATE instead of ...
408115 Dec 2015 @ 02:10 PSTDatabaseReplyAnalysis of skew of spool filesHi Dag, if StepInfo is enabled QryLogStepsV will show details including spool for each step
408015 Dec 2015 @ 02:09 PSTGeneralReplyInsert is taking so much timeAdding partitioning might help. Can you show the table DDL plus the Insert/Selects? Why do you need to run so many iterations?
407911 Dec 2015 @ 07:38 PSTDatabaseReply"WITH RECURSIVE" CONCATENATION RESULT TRUNCATEDYou must apply the cast in the seed query (the 1st query of a set operation determines the resulting datatype): WITH RECURSIVE SAV_TAB (SERV, SRV, OFR, DAT_ACTIVATION, LIBL_OFFR, IDNT_TCK_CLT, N...

Pages