#DateForumTypeThreadPost
325328 Oct 2014 @ 01:19 PDTDatabaseReplyAVG() FUNCTION RETURNING DIFFERENT VALUES FOR SAME INPUTHi Arun, the resulting datatype of an AVG is a FLOAT. What's the datatype of the base column? You can rewrite an any AVG(column) using SUM(column) / COUNT(column) which will use the original...
325228 Oct 2014 @ 01:16 PDTToolsReplyFLOAD Script throws error "TPT_INFRA: At "select" missing SEMICOL_ in rule: Job Definition Body"FastLoad is for loading data into TD from an external source.  But your script doesn't load any data, you try to use a Select as source, of course this will not work. Why don't ...
325127 Oct 2014 @ 02:54 PDTGeneralReplySelect data from one row, while on another row in the same table.Hi Genesius, the CTE is a Common Table Expression, similar to a Derived Table (aka Inline View), just easier to use when you need to access the same Select twice. You probably run this query on a...
325027 Oct 2014 @ 02:48 PDTData ModelingReplyCasting integers....Hi Dan, my crystal ball is "not working", too. What doesn't work, is there an error message?
324926 Oct 2014 @ 07:39 PDTTeradata ApplicationsReplyUTY3403 Only one statement per line is allowed. Extra characters were detected beginning in column '10''You should show the output of running this script, it should stop right where this error occured, usually it's due to a non-visible character like a tab.   And the semicolons at the end ...
324826 Oct 2014 @ 07:35 PDTDatabaseReplyError While Trying to cast as TimestampHi Sarang, Excel stores the number of days since a starting date, 1900-01-01 is day 1. So the difference between the start_dt and this starting date is almost correct, you just need to substract &...
324725 Oct 2014 @ 02:57 PDTDatabaseReplyError While Trying to cast as TimestampHi Sarang, there are many ways to store a date in an integer :)     So how is the date stored (yyyymmdd?) and what's the user's input?
324624 Oct 2014 @ 02:19 PDTDatabaseReplyconvert month number to month nameI don't get what you want, the title is about month number/name, but the T-SQL snippet is something totally different. And then you ask why the CASE doesn't change the existing status? &n...
324524 Oct 2014 @ 10:48 PDTGeneralReplySelect data from one row, while on another row in the same table.Hi Genesius, you need to do the same calculation on based on NewDueDate, but as OLAP functions can't be nested you must use a Derived Table instead (or a WITH) like this: WITH cte AS ( SE...
324424 Oct 2014 @ 10:33 PDTDatabaseReplyError While Trying to cast as TimestampHi Sarang, the field seems to be a number of seconds, of course can't you cast that to a Time.   You need an Interval instead: Tot_Answered * interval '00:00:01' second &nbs...
324324 Oct 2014 @ 10:31 PDTDatabaseReplyTO_BYTES adding leading zero byteAny byte with the high bit set (>= '80) will return a leading '00'. This seems to be based on interpreting the string as a signed value, when you compare it to the TO_BYTE function ...
324224 Oct 2014 @ 10:21 PDTDatabaseReplyPREPARE Statement in conjunction with CursorTo return the results of a SELECT you need to use a cursor in Teradata (and Standard SQL), of course this is not a real cursor where you fetch one row after the other, it's just a spool like an...
324124 Oct 2014 @ 09:56 PDTUDAReply[Performance] how to avoid parsing time when executing macro via JDBC CacheFlag='A' (mostly 95% of queries processed) It's a complex query and the optimizer decided to ignore the PREPARE. According to the Admin manual: "A" if a Specific A...
324022 Oct 2014 @ 02:49 PDTDatabaseReplyhistory handled output requiredThis looks similar to maintaining a Slowly Changing Dimension, this might involve quite complex logic. Maybe it's enough to do a UNION ALL and then apply some logic using OLAP to the previous ...
323922 Oct 2014 @ 02:46 PDTDatabaseReplyPadding a field in a select statement with spacesAdding trailing spaces? CAST('bla' AS CHAR(19))
323822 Oct 2014 @ 02:44 PDTToolsReplyTPT export large table to smaller text filesIf it doesn't have to be exactly 5,000,000 rows per file you might simply use multiple instances of the file writer APPLY TO OPERATOR (FILE_WRITER[16]), this will create 16 files each like...
323722 Oct 2014 @ 12:06 PDTDatabaseReplyStart dates overlap Change my query to PARTITON BY per_id, your logic is probably quite similar, based on the previous row's value.
323622 Oct 2014 @ 11:50 PDTDatabaseReplyFLAT SQL to SET SQLThere's no SET in a SELECT. SETing a variable translates to assigning an alias to the calculation and then use it within the same level or in a Derived Table, e.g. SELECT CASE W...
323522 Oct 2014 @ 11:07 PDTGeneralReplyAdditional padding characters that are not removable with TRIM functionrtrim(COL1,'2000'XC) is valid syntax in TD14.10, there must be some other problem.
323422 Oct 2014 @ 11:02 PDTPrivate Forum
323322 Oct 2014 @ 10:57 PDTData ModelingReplyNested Update - Case issueThere's a lot of invalid syntax, too many CASEs and no comparison for the first COALESCE. Try to get your syntax running with a SELECT first.
323222 Oct 2014 @ 10:49 PDTDatabaseReplyTD_UNPIVOT throwing error: SELECT Failed. [9134] TD_UNPIVOT_CONTRACT; Help is confusingI don't know why it's failing, you might open an incident with TD customer service to check what's wrong.
323122 Oct 2014 @ 10:33 PDTDatabaseReplyIndex on UPPER(col1)#1: There are no expression-based indexes in Teradata #2: When you need a case-insensitive comparison in Teradata you simply define the column as NOT CASESPECIFIC (thus avoiding the UPPER). This i...
323022 Oct 2014 @ 10:10 PDTDatabaseReplyGroup by Case sensitive?Hi Rajesh, GROUP BY is based on the [NOT] CASESPECIFIC column attribute. Your column is defined as not being case sensitive, so both 'r' and 'R' are considered equal. Change your...
322921 Oct 2014 @ 11:40 PDTDatabaseReplyhistory handled output requiredYou didn't specify any rules how you determine the expected result set. E.g. what if there are multiple/no rows per cust_id(?) per table, what if they are conflicting, ...?

Pages