#DateForumTypeThreadPost
240328 Nov 2013 @ 01:08 PSTDatabaseReplyRe-writing a query interms of performanceAll those unique indexes seem suspicious, are they actually based on access/join paths or do they just implement the logical keys? A NUPI (FIRST_DT ,VISITOR_ID) on T_CUST would allow a direct ...
240227 Nov 2013 @ 03:10 PSTDatabaseReplyNeed help getting rid of parcel length error in BTEQ scriptThe default PACK factor in BTEQ is always 1, so changing it will not fix the problem. REPORT format expects only fixed length CHARs, when you define a VARCHAR the first two chars are treated as th...
240125 Nov 2013 @ 01:58 PSTToolsReplyCreating ODBC DSN for Teradata DatabaseHi Mohammad, what did you download/install, Teradata Express for VMWare (the DBMS) or TTU (the client)? In TD14 there's no more Windows version for DBMS, there's only a virtual machine ru...
240024 Nov 2013 @ 03:16 PSTDatabaseReplyUpdate current row from the results from previous rowCalculate the values in an UPDATE FROM: SELECT seq_no, num, SUM_FROM_PREV_REC, COALESCE(SUM(SUM_FROM_PREV_REC) OVER (ORDER BY seq_no ROWS UNBOUNDED PRECEDING),0) + COALESC...
239922 Nov 2013 @ 04:12 PSTDatabaseReplyneed help in implementing a scenarioIt's easy to get the previous value with OLAP-functions: select cust_id, date, min(Closing_Inventory) over (partition by cust_id order by date rows between 1 p...
239821 Nov 2013 @ 10:53 PSTDatabaseReplyNeed to increase the query performanceHi Sekhar, you're inserting 5 million rows with the same PI to a SET table, that's worst case. Changing the table to be MULTISET would help, but you better change the PI to something usef...
239720 Nov 2013 @ 12:51 PSTDatabaseReplyTrimming Blank Inner Spaces & Data CleansingThere's no REPLACE function in Teradata, but there might be oREPLACE (REPLACE was already a keyword thus it has to be renamed). Your query replaces multiple blanks with a single blank, but i t...
239620 Nov 2013 @ 12:06 PSTPrivate Forum
239520 Nov 2013 @ 12:05 PSTDatabaseReplyDBC.tvFields.CompressValue does not existWhich client do you use to "double-click"? It seems to directly access the base tables (which is strongly not recommended) instead of the views.  Regarding dbc.Colums it's stra...
239419 Nov 2013 @ 11:49 PSTGeneralReplyHow to post a blog?Hi Raja, Becoming A Contributor
239319 Nov 2013 @ 11:48 PSTDatabaseReplymacro sql OptimizationThere's no partition elimination in the 2nd explain because this has been submitted using Prepared SQL (':?') while the 1st explain was done with hard-coded literals.   There sho...
239214 Nov 2013 @ 11:24 PSTDatabaseReplyIncrease the size of DBCDBC can only be restored to a freshly SYSINITed system. The available perm space of the Express version can't be increased, you better download the 1TB version.
239114 Nov 2013 @ 11:04 PSTDatabaseReplyRecursive QueryHi Sarah, assuming your actual data is not based on increasing values you need to do a recursion starting with the LATEST_DND: WITH RECURSIVE cte(DND_NO, REC1, LATEST_DND) AS ( SELECT DND...
239009 Nov 2013 @ 10:04 PSTDatabaseReplyRecursive QueryHi Sarah, i can't see any rule how to calculate this data.  Why is LATEST_DND the same as REC1, just for 104 it's 4015? 4015 doesn't seem to be based on any kind of calulation. ...
238909 Nov 2013 @ 04:35 PSTTeradata ApplicationsReplyProductJoin join condition of ("LOGGING_KEY = ETL_TEMP_HIX_DEV.TABLE4.LOGGING_KEY"A prodcut join is not bad per se, it might actually be the least expensive plan. Check the estimated number of rows for the step preparing the join (the one with a "duplicated to all AMPs&quo...
238809 Nov 2013 @ 04:21 PSTDatabaseReplyDelete or Drop a table if it already existsHi Khurram, sheridany probably referred to the .if activitycount and .label code which are GUI commands in BTEQ and SQLA, but don't exist in ODBC.
238709 Nov 2013 @ 04:12 PSTPrivate Forum
238609 Nov 2013 @ 03:55 PSTDatabaseReplyRecursive QueryHi Sarah, i don't know your actual business question, but looking at your source code i don't think you need neither recursion nor the TEMP_REC1 table. Seems like a job for OLAP-functions....
238506 Nov 2013 @ 03:29 PSTDatabaseReplyAlgorithm and sql ways for Sorting and matching dataYou need to explain in more detail on which rules those cycles are based.   Dieter
238404 Nov 2013 @ 11:44 PSTData ModelingReplyPPI table having a column for same PI and SI You can define a SI on top of the PI if the table is partitioned :-) In fact it's even recommended when there are lots of partitions and the partitioning column is not part of the PI and you n...
238301 Nov 2013 @ 03:08 PDTGeneralReplyNeed to find difference between the effective column of the next row and expiration column of the previous rowGetting the previous row's value is a simple OLAP function: eff_date - MIN(end_date) OVER (PARTITION BY id ORDER BY eff_date ROWS BETWEEN 1 PRECEDING AND 1 PRECEDING) DA...
238201 Nov 2013 @ 03:00 PDTGeneralReplyQuerybanding in Oracle,SQL server,Db2MD5 should be easy, all those DBMSes suppport UDFs. But afaik none supports a functionality similar to Querybanding.   Dieter
238101 Nov 2013 @ 11:02 PDTDatabaseReplyPI for slowly changing data table Hi Prat, if the number of rows per customer is not too high you should keep cust_id as PI. When most of the queries access the current data (= where end_date = date '9999-12-31') you migh...
238001 Nov 2013 @ 10:31 PDTDatabaseReplyNeed to Remove Duplicates from a dataset ROW_NUMBER() OVER (PARTITION BY id, status, store ORDER BY update_date) will not work for your problem as it will not flag a row where the same (status,store) combination is found in multiple...
237901 Nov 2013 @ 10:15 PDTViewpointReplyDSAHi Raja,   as DSA is a database feature it will not be available for 13.10. There was a presentation at Partners indicating two major features: - much faster backup speed - true increment...

Pages