2403 | 28 Nov 2013 @ 01:08 PST | Database | Reply | Re-writing a query interms of performance | All 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 ... |
2402 | 27 Nov 2013 @ 03:10 PST | Database | Reply | Need help getting rid of parcel length error in BTEQ script | The 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... |
2401 | 25 Nov 2013 @ 01:58 PST | Tools | Reply | Creating ODBC DSN for Teradata Database | Hi 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... |
2400 | 24 Nov 2013 @ 03:16 PST | Database | Reply | Update current row from the results from previous row | Calculate 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... |
2399 | 22 Nov 2013 @ 04:12 PST | Database | Reply | need help in implementing a scenario | It'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... |
2398 | 21 Nov 2013 @ 10:53 PST | Database | Reply | Need to increase the query performance | Hi 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... |
2397 | 20 Nov 2013 @ 12:51 PST | Database | Reply | Trimming Blank Inner Spaces & Data Cleansing | There'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... |
2396 | 20 Nov 2013 @ 12:06 PST | Private Forum |
2395 | 20 Nov 2013 @ 12:05 PST | Database | Reply | DBC.tvFields.CompressValue does not exist | Which 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... |
2394 | 19 Nov 2013 @ 11:49 PST | General | Reply | How to post a blog? | Hi Raja,
Becoming A Contributor
|
2393 | 19 Nov 2013 @ 11:48 PST | Database | Reply | macro sql Optimization | There'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... |
2392 | 14 Nov 2013 @ 11:24 PST | Database | Reply | Increase the size of DBC | DBC 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.
|
2391 | 14 Nov 2013 @ 11:04 PST | Database | Reply | Recursive Query | Hi 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... |
2390 | 09 Nov 2013 @ 10:04 PST | Database | Reply | Recursive Query | Hi 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.
... |
2389 | 09 Nov 2013 @ 04:35 PST | Teradata Applications | Reply | ProductJoin 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... |
2388 | 09 Nov 2013 @ 04:21 PST | Database | Reply | Delete or Drop a table if it already exists | Hi 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.
|
2387 | 09 Nov 2013 @ 04:12 PST | Private Forum |
2386 | 09 Nov 2013 @ 03:55 PST | Database | Reply | Recursive Query | Hi 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.... |
2385 | 06 Nov 2013 @ 03:29 PST | Database | Reply | Algorithm and sql ways for Sorting and matching data | You need to explain in more detail on which rules those cycles are based.
Dieter
|
2384 | 04 Nov 2013 @ 11:44 PST | Data Modeling | Reply | PPI 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... |
2383 | 01 Nov 2013 @ 03:08 PDT | General | Reply | Need to find difference between the effective column of the next row and expiration column of the previous row | Getting 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... |
2382 | 01 Nov 2013 @ 03:00 PDT | General | Reply | Querybanding in Oracle,SQL server,Db2 | MD5 should be easy, all those DBMSes suppport UDFs.
But afaik none supports a functionality similar to Querybanding.
Dieter
|
2381 | 01 Nov 2013 @ 11:02 PDT | Database | Reply | PI 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... |
2380 | 01 Nov 2013 @ 10:31 PDT | Database | Reply | Need 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... |
2379 | 01 Nov 2013 @ 10:15 PDT | Viewpoint | Reply | DSA | Hi 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... |