#DateForumTypeThreadPost
412823 Jan 2016 @ 10:35 PSTDatabaseReply2616: 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, ...
412721 Jan 2016 @ 04:00 PSTDatabaseReplyCALCULATING AVERAGE FROM TIME INTERVALHi 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&...
412621 Jan 2016 @ 01:19 PSTDatabaseReplyACTIVITY_COUNT of DBC.SysExecSQLSimply use it: CALL dbc.sysexecsql(...); SET myVAr = ACTIVITY_COUNT; Btw, better use Standard compliant EXECUTE IMMEDIATE instead of SysExecSQL.
412521 Jan 2016 @ 01:11 PSTDatabaseReplyCasting a DEC(10,4) to INT - strange resultsLooks like an optimizer bug to me, Explain shows a single-AMP PI-access on 15.10.00.08, too. Open an incident.
412420 Jan 2016 @ 09:27 PSTDatabaseReplySQL Question about use of LEFT, RIGHT and SUBSTR functionsHi 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 ...
412320 Jan 2016 @ 09:23 PSTToolsReplyTeradata Statistics WizardStatistics Wizard is discontinued, 14.10 was the last version, it's replaced by the new AutoStats feature & Viewpoint's Stats Manager.
412220 Jan 2016 @ 09:19 PSTToolsReplyEditing queries in column Mode for SQL Assistant v15Hi 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.
412120 Jan 2016 @ 09:17 PSTDatabaseReplyMaster indexYou 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 ...
412018 Jan 2016 @ 11:39 PSTDatabaseReplyCan REGEXP_REPLACE be used to replace multiple strings with multiple replace stringsNone 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...
411918 Jan 2016 @ 01:13 PSTDatabaseReply3806: Table/view/trigger name is ambiguousYou 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
411818 Jan 2016 @ 10:14 PSTTeradata ApplicationsReplyVarchar expanding to its maximum length in fexp - ALSO USING THIS FIELD IN ORDER BYOops, you're running ANSI-mode sessions. Of course, then you need CAST(SUBSTRING).
411718 Jan 2016 @ 07:30 PSTDatabaseReplySearching for most recent non-zero recordsYou 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 ...
411617 Jan 2016 @ 02:24 PSTDatabaseReplyReturn a specific date30 years are 360 months: ADD_MONTHS(BIRTH_DATE, 30*12)
411517 Jan 2016 @ 05:57 PSTDatabaseReplyString Concat - returning multiple rows in one string cocat rowPlease 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 ...
411417 Jan 2016 @ 04:25 PSTTeradata ApplicationsReplyVarchar 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...
411317 Jan 2016 @ 03:39 PSTGeneralReplyDate Conversion Issue, from String to DATEThis 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 ...
411216 Jan 2016 @ 04:00 PSTDatabaseReplyInvalid calculation: division by zeroThere's a simple rule to avoid this error, whenever you divide use NULLIF, e.g.: ss_sb1.qty / NULLIF(ss_p2.cumpct, 0)  
411108 Jan 2016 @ 07:47 PSTTeradata ApplicationsReplyDOT CHARACTER FOR BTEQ, FASTLOAD AND MULTILOAD COMMANDSWhen you try it (e.g. run HELP BTEQ;) you will notice that it's not mandatory :)  
411008 Jan 2016 @ 06:04 PSTTeradata ApplicationsReplyDOT CHARACTER FOR BTEQ, FASTLOAD AND MULTILOAD COMMANDSThe 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...
410908 Jan 2016 @ 02:08 PSTDatabaseReplyTracking Time When Last AccessedHi 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...
410806 Jan 2016 @ 10:53 PSTDatabaseReplyI need help to convert SQL management query to TeradataDateAdd(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))
410706 Jan 2016 @ 10:45 PSTDatabaseReplyISO 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...
410605 Jan 2016 @ 10:19 PSTDatabaseReplyMaterialize (or spool) WITH clause queriesHi 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...
410505 Jan 2016 @ 10:14 PSTDatabaseReplyISO 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, ...
410405 Jan 2016 @ 04:50 PSTDatabaseReplySimple merging of records based on DateThis 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...

Pages