4128 | 23 Jan 2016 @ 10:35 PST | Database | Reply | 2616: Numeric overflow occurred during computation. | Hi Fred,
it's a workaround, but running an OLAP function twice on a 2.5 billion row table is a huge overhead.
I really don't know why those functions can't return a BIGINT on demand, ... |
4127 | 21 Jan 2016 @ 04:00 PST | Database | Reply | CALCULATING AVERAGE FROM TIME INTERVAL | Hi Jeremy,
you probably got an "interval overflow" error?
You might try increasing the interval precision like AVG(END_T - STRT_T DAY(4) TO MINUTE).
Or use the calculation I posted at&... |
4126 | 21 Jan 2016 @ 01:19 PST | Database | Reply | ACTIVITY_COUNT of DBC.SysExecSQL | Simply use it:
CALL dbc.sysexecsql(...);
SET myVAr = ACTIVITY_COUNT;
Btw, better use Standard compliant EXECUTE IMMEDIATE instead of SysExecSQL.
|
4125 | 21 Jan 2016 @ 01:11 PST | Database | Reply | Casting a DEC(10,4) to INT - strange results | Looks like an optimizer bug to me, Explain shows a single-AMP PI-access on 15.10.00.08, too.
Open an incident.
|
4124 | 20 Jan 2016 @ 09:27 PST | Database | Reply | SQL Question about use of LEFT, RIGHT and SUBSTR functions | Hi Richard,
if you run TD15.10 all three should work, before both LEFT and RIGHT were not built-in, but the ODBC (JDBC?) driver might rewrite them to vaild TD syntax.
So what's your TD ... |
4123 | 20 Jan 2016 @ 09:23 PST | Tools | Reply | Teradata Statistics Wizard | Statistics Wizard is discontinued, 14.10 was the last version, it's replaced by the new AutoStats feature & Viewpoint's Stats Manager.
|
4122 | 20 Jan 2016 @ 09:19 PST | Tools | Reply | Editing queries in column Mode for SQL Assistant v15 | Hi Darshan,
you must be a custumer to get access to Teradata's patch server (if you are simply ask your DBA).
Hopefully there will be a 15.10 TTU soon.
|
4121 | 20 Jan 2016 @ 09:17 PST | Database | Reply | Master index | You got something wrong, the Table/RowID ranges stored on cylinders will never overlap.
The "Lowest Table/RowID" of the (logically) following cylinder will be greater than the ... |
4120 | 18 Jan 2016 @ 11:39 PST | Database | Reply | Can REGEXP_REPLACE be used to replace multiple strings with multiple replace strings | None of your example rows match this RegEx searching for:
'Order' followed by an optional space or single quote followed by a 10 to 15 digit order number followed by an optional single quo... |
4119 | 18 Jan 2016 @ 01:13 PST | Database | Reply | 3806: Table/view/trigger name is ambiguous | You didn't create the VT in your Default Database, but within your user :-)
Volatile Tables can only be qualified by the username, i.e. select * from username.MEMBER
|
4118 | 18 Jan 2016 @ 10:14 PST | Teradata Applications | Reply | Varchar expanding to its maximum length in fexp - ALSO USING THIS FIELD IN ORDER BY | Oops, you're running ANSI-mode sessions.
Of course, then you need CAST(SUBSTRING).
|
4117 | 18 Jan 2016 @ 07:30 PST | Database | Reply | Searching for most recent non-zero records | You always need the most current row plus consecutive rows where Inventory <> 0:
SELECT
t.*,
SUM(CASE WHEN Inventory = 0 THEN 1 ELSE 0 end)
OVER (PARTITION BY Product
... |
4116 | 17 Jan 2016 @ 02:24 PST | Database | Reply | Return a specific date | 30 years are 360 months: ADD_MONTHS(BIRTH_DATE, 30*12)
|
4115 | 17 Jan 2016 @ 05:57 PST | Database | Reply | String Concat - returning multiple rows in one string cocat row | Please don't add new questions to old posts, post new topic by pressing the "CREATE A NEW FORUM TOPIC" button on top of each forum's main page.
The range of a BYTEINT is ... |
4114 | 17 Jan 2016 @ 04:25 PST | Teradata Applications | Reply | Varchar expanding to its maximum length in fexp - ALSO USING THIS FIELD IN ORDER BY |
A string is always expanded to the defined size, SUBSTRING will not change that.
You wrote "the actual data saved in this description field < 255 bytes", you can sim... |
4113 | 17 Jan 2016 @ 03:39 PST | General | Reply | Date Conversion Issue, from String to DATE | This result is really strange.
According to the SQL Functions & Operators manual DATE + DATE does not report an error, but results are generally not meaningful.
I never checked the ... |
4112 | 16 Jan 2016 @ 04:00 PST | Database | Reply | Invalid calculation: division by zero | There's a simple rule to avoid this error, whenever you divide use NULLIF, e.g.:
ss_sb1.qty / NULLIF(ss_p2.cumpct, 0)
|
4111 | 08 Jan 2016 @ 07:47 PST | Teradata Applications | Reply | DOT CHARACTER FOR BTEQ, FASTLOAD AND MULTILOAD COMMANDS | When you try it (e.g. run HELP BTEQ;) you will notice that it's not mandatory :)
|
4110 | 08 Jan 2016 @ 06:04 PST | Teradata Applications | Reply | DOT CHARACTER FOR BTEQ, FASTLOAD AND MULTILOAD COMMANDS | The period is optional for BTEQ & FastLoad, but mandatory for MultiLoad/TPump/FastExport.
This is from the FastLoad manual:
The following syntax rules apply when using Teradata FastLoad co... |
4109 | 08 Jan 2016 @ 02:08 PST | Database | Reply | Tracking Time When Last Accessed | Hi Taha,
"?" is the default for displaying NULL in BTEQ and SQL Assistant.
If LastAccessTimestamp is NULL use count collection is not enabled on this system (pre-TD14.10) or on thi... |
4108 | 06 Jan 2016 @ 10:53 PST | Database | Reply | I need help to convert SQL management query to Teradata | DateAdd(DAY, DateDiff(DAY, 0, GetDate()), 0) returns the start of the current day as a DateTime, this is equivalent to CAST(CURRENT_DATE AS TIMESTAMP(0))
|
4107 | 06 Jan 2016 @ 10:45 PST | Database | Reply | ISO calendar : previous week number issue | Hi Fred,
this works fine for weeks, as it returns any day within that week.
I did a pair of SQL-UDFs a few years ago to return the first day of the ISO week, i.e. monday:
-- 201335
REPLACE FU... |
4106 | 05 Jan 2016 @ 10:19 PST | Database | Reply | Materialize (or spool) WITH clause queries | Hi Khaled,
there's no way to tell the optimizer to spool a WITH (he will do it in some cases, in others he won't).
I manually create a Volatile Table in such a case, this also allow... |
4105 | 05 Jan 2016 @ 10:14 PST | Database | Reply | ISO calendar : previous week number issue | Hi Sunny,
those functions are not based on ISO.
Use the Business Calendar Functions instead:
WEEKNUMBER_OF_YEAR(datecol, 'iso'),
YEARNUMBER_OF_CALENDAR(datecol, 'iso')
Btw, ... |
4104 | 05 Jan 2016 @ 04:50 PST | Database | Reply | Simple merging of records based on Date | This will normalize both overlapping and continous periods. It looks for gaps in the Derived Table (current start date greater than maximum previous end date) and then constructs the end date in th... |