2553 | 25 Jan 2014 @ 12:16 PST | Database | Reply | RDBMS failure, 3538: A MultiLoad UPDATE Statement is Invalid | The rules for PIs in MLoad apply also to PPI:
All Primary Index columns plus all partitioning columns must be specified in the WHERE-caluse and must not be modified by an UPDATE, i.e. the ROWID ca... |
2552 | 25 Jan 2014 @ 12:06 PST | Database | Reply | Query to find tables with no stats defined/old statistics | Did you run my the version for TD13 on a TD14 system?
The old statsinfo will still run and return NULL for everything, as stats are no longer stored in tvfields and indices.
You have to use the T... |
2551 | 25 Jan 2014 @ 01:12 PST | Database | Reply | Substring Extract | You don't need to specify the length when you want to get all chatacters until the end of the string, so this can be further simplified:
SELECT
SUBSTRING(long_str FRO... |
2550 | 24 Jan 2014 @ 07:48 PST | Database | Reply | Converions of timestamp to FORMAT 'MM/DD/YYYYBHH:MI:SS' | Hi Nishant,
works for me in both BTEQ and SQL Assistant over ODBC/.NET:
SELECT '01/23/2014 11:53:50.000000' AS ts,
ts (TIMESTAMP, FORMAT 'MM/DD/YYYYBHH:MI:SS.S(6)') AS a,
... |
2549 | 24 Jan 2014 @ 05:41 PST | General | Reply | using a calculation done in the previous row in this row's calculation | Yes, you need to Cross Join years and companies, preferable not on the big table, better use the comanies table. But of course it's still a an extra step.
Regarding EXPAND ON, i wrote a simila... |
2548 | 24 Jan 2014 @ 01:26 PST | Database | Reply | Getting week of the year from a date | This is quite similar to the week_of_year calculation in sys_calendar (as long as week 1 of 2014 doesn't include 2013-12-31).
Using sys_calendar.calendar:
((day_of_year - day_of_week) ... |
2547 | 24 Jan 2014 @ 01:12 PST | Database | Reply | SQL Workaround | Hi Kelvin,
130+ records is not skewed - unless the "+" includes at least 5 to 6 diigt numbers :-)
What's the PI of those tables and number of rows?
Which table is redistributed bas... |
2546 | 24 Jan 2014 @ 01:02 PST | Analytics | Reply | GROUP BY ROLLUP | I t's not clear waht you want, at least for me.
Are you talking about a single table?
Can you please elaborate on your tables, data and rules?
Btw, you don't need to do an aggregation wh... |
2545 | 24 Jan 2014 @ 12:56 PST | General | Reply | using a calculation done in the previous row in this row's calculation | That's quite complicated.
A possible solution is a Cross Join between the list of years and the list of companies to create all combinations, followed by an Left Join to your query and finally... |
2544 | 24 Jan 2014 @ 12:46 PST | Tools | Reply | new line character | @Raja:
I assume Ekladios wanted to avoid oReplace because it's not installed on his system.
If there's no oReplace the probability to for a RegExp function is almost zero :-)
@Ek... |
2543 | 24 Jan 2014 @ 12:03 PST | Database | Reply | Delete or Drop a table if it already exists | REPLACE VIEW is not a new feature in TD14, you can do that since at least V2R2 :-)
Other DBMSes use CREATE OR REPLACE VIEW syntax for this functionality.
But there's no REPLACE TABLE syntax w... |
2542 | 23 Jan 2014 @ 09:36 PST | Database | Reply | Lagging variables | You need an ORDER BY:
select account_id,
date,
flag_1,
max(flag_1)
over (partition by account_id
order by date
rows b... |
2541 | 23 Jan 2014 @ 06:23 PST | Database | Reply | Stored Procedures and I/O | Can you share a bit more details?
Is it the same target table for all queries?
Do you run that SP in ANSI or Teradata mode?
Are there any Secondary/Join Indesex?
Do you also DELETE data?
|
2540 | 23 Jan 2014 @ 03:49 PST | Database | Reply | ROWID in Teradata | In fact there is a ROWID for each row, but it's usage has been disabled in V2R5, mainly due to Oracle users abusing it :-)
The keyword ROWID was implemented in V2R3 and was supposed to be used... |
2539 | 23 Jan 2014 @ 01:43 PST | Database | Reply | SQL statements in UNION executes serial or parallel | Hi Bikky,
a UNION needs to insert both results into the same spool -> the individual SELECT might run in parallel (if they need multiple steps due to joins, etc), but the final inserts are alwa... |
2538 | 22 Jan 2014 @ 01:32 PST | Database | Reply | Getting week of the year from a date | Hi San,
when you want 1st of january to be in week 1, both sys_calendar and iso calendar will fail.
Can you elaborate about the rules for this calendar?
When does a week start, sunday or monday?... |
2537 | 22 Jan 2014 @ 09:39 PST | General | Reply | Status of queries | MonitorSession returns info about all sessions, only DBAs are usually allowed to do this.
If you only want to see your queries you can try:
SELECT * FROM TABLE (MonitorMySessions()) AS dt;
If ... |
2536 | 22 Jan 2014 @ 09:35 PST | Database | Reply | Getting week of the year from a date | What's you Teradata release? <13.10?
|
2535 | 22 Jan 2014 @ 01:51 PST | Database | Reply | Which is efficient? | Derived Tables are only materialzed when there's something like DISTINCT/GROUP BY/OLAP.
Otherwise they are already resolved by the parser. Also any unused columns are removed from the pa... |
2534 | 21 Jan 2014 @ 06:23 PST | Database | Reply | Find usage | #1: probably CpuTime or CptPct
#2: of course there's no idle, etc., to which WD this should be assigned.
The max available CPU time will not change unless you add new nodes or upgarde the CPU... |
2533 | 21 Jan 2014 @ 06:12 PST | Teradata Studio | Reply | Getting row counts | Hi Francine,
I didn't know about that restriction of the JDBC driver, that sounds really bad :-(
I always liked to know in advance how many rows will be returned, I think I'll better keep... |
2532 | 21 Jan 2014 @ 01:22 PST | General | Reply | teradata linked table in access database how to format date in string | You can pass a date as a string '2000-01-01' but it must match the FORMAT of the target column.
There's only one recommended way to write a date in Teradata: DATE '2000-01-01',... |
2531 | 21 Jan 2014 @ 01:10 PST | Database | Reply | Cast-DATE | Hi Sri,
you can extract year/month/day using MOD/DIV, e.g.
CAST(((x MOD 100) + CASE WHEN (x MOD 100) < 20 THEN 100 ELSE 0 END) * 10000 -- year 19xx or 20xx
+ (x / 10000) * 100 -- month... |
2530 | 21 Jan 2014 @ 01:04 PST | Database | Reply | Find usage | You'll find similar CPU info in several other ResUsage tables.
If your calculation is based on WDs you should check dbc.ResSpsView.
DBQL is not really reliable for consumed CPU seconds, not a... |
2529 | 20 Jan 2014 @ 11:37 PST | Database | Reply | Find usage | Check dbc.ResUsageScpu/ResScpuView.
This is from the Resource Usage Macros and Tables manual:
The CPU utilization columns are aggregates representing all CPUs on the node. CPU
u... |