#DateForumTypeThreadPost
405324 Oct 2015 @ 11:09 PDTGeneralReplyIs this explain plan normal?Hi Zarrar, this is usually the optimizer's plan for UNIONing two SELECTs.
405223 Oct 2015 @ 11:52 PDTAnalyticsReplyWhat, no REPEAT(X,n) function for Teradata?Since TD14 there's LPAD/RPAD or TO_CHAR: LPAD(TRIM(ACC_No), 8, '0') TO_CHAR(Acc_no, '00000000') Before you can apply a FORMAT:   CAST(CAST(Acc_no AS FORMAT '9...
405123 Oct 2015 @ 11:46 PDTAnalyticsReplyHow strip of the non numeric data from VARCHAR fieldIf you only want to digits only: WHERE REGEXP_SIMILAR(col1, '^[0-9]*$') = 0 Or WHERE RTRIM(col1, '0123456789') = ''  
405023 Oct 2015 @ 11:36 PDTGeneralReplyTeradata SQL Assist - Datepart FunctionWhen does your week start, Sunday or Monday? All the sys_calendar colunms are available as functions, too: -- week starts on Sunday: td_day_of_week(current_date) or DayNumber_Of_W...
404919 Oct 2015 @ 09:45 PDTDatabaseReplyModify TD maximum of 16 open responses per connectionThere's no way to increase this limit, it's built-in. But usually recursion can be rewritten with loops :-)
404819 Oct 2015 @ 09:43 PDTConnectivityReplyFunctions doesn't work with the ODBC connectionMONTH is an ODBC function which is rewritten to valid Teradata SQL by the ODBC driver if the "Disable Parsing" option has not been checked and the query is a DML statement.  &n...
404719 Oct 2015 @ 12:26 PDTDatabaseReplyPerformance issue with Coalesce Hi Amit, COALESCE in joins might change the plan, if it's in a join on the PI-columns when NULLs should be treated equal. In that case there's a recommendation to use ON (t1.col = t2.col O...
404618 Oct 2015 @ 10:45 PDTDatabaseReplyOrder by DateI never encountered problems with sort orderm but without showing both "order by" it's hard to tell... Q1: Of course casting a date to string might change the order if it's not b...
404516 Oct 2015 @ 10:45 PDTDatabaseReplyLOCK IN ACCESS SELECT timestamp effectivenessHi RS, please post new questions a new topic. Regarding the product join: http://forums.teradata.com/forum/general/recursive-query-spool-space-error#comment-136853
404416 Oct 2015 @ 10:41 PDTTeradata ApplicationsReplyTeradata Addition IssueYou assign an alias "TotalWork", but there's also a column "q4.totalwork", when you use "TotalWork" in "cast (TotalWork/Totalhrs as decimal (20,2)" it...
404315 Oct 2015 @ 11:55 PDTTeradata ApplicationsReplyTeradata Addition IssueStrange, can you show some actual data plus result?
404215 Oct 2015 @ 11:52 PDTDatabaseReplyHow to get previous row valuesWhat's your release? In TD14.10 there's  LAST_VALUE(place IGNORE NULLS) over (partition by name ORDER BY id)  
404115 Oct 2015 @ 11:48 PDTDatabaseReplyAverage across columns - How can I do this better and in cleaner code?Hi Will, logic is correct, code is correct, result is correct :-)   I would just do some cosmetic changes by replacing the proprietary ZEROIFNULL/NULLIFZERO with a Standard SQL COALESCE/ NU...
404015 Oct 2015 @ 11:44 PDTDatabaseReplyPerformance issue with Coalesce Hi Amit, COALESCE doesn't use much CPU, but it might change the optimizer's plan. I don't know if rewriting the logic will help: OR ~DATABASE_NAME_BASE~.~TABLE_NAME~.TYPE_ID <&g...
403915 Oct 2015 @ 11:24 PDTDatabaseReplyNeed to calculate Age in days of a recordThis is SQL Server syntax, why don't you ask in a Microsoft forum? SYSDATETIME returns a datetime2 and you can't use plus/minus on that datatype, you need to use DATEDIFF instead: DATED...
403815 Oct 2015 @ 12:47 PDTDatabaseReplyquery to bring in multiple row values into one recordTo split in two columns you don't need two Recursive Queries, simply split the data into tw columns when you create the Volatile Table. Additionally you can change the logic to start with the ...
403715 Oct 2015 @ 12:38 PDTDatabaseReplyLOCK IN ACCESS SELECT timestamp effectivenessHi Pierre, "before the beginning of INSERT TRANSACTION" would be READ COMMITED, but ACCESS LOCK means READ UNCOMMITTED, i.e. you might read a block with already inserted rows = &quo...
403615 Oct 2015 @ 12:30 PDTDatabaseReplyregexp_replace woesFirst some control characters are replaced by a space: \f = 0x0C form feed  \n = 0x0A newline \r = 0x0D carriage return \t = 0x09 horizontal tab \v = 0x0B vertical tab And...
403515 Oct 2015 @ 08:21 PDTDatabaseReplyActivating new character sets other than defaultAnd have a look at the Unicode Tool Kit if you got some characters which fail to import
403415 Oct 2015 @ 08:18 PDTDatabaseReplyFailed Query! Not sure why - 3706 Syntax Error?Hi Sandeep, please post new questions as new topic.   #1: ISO & ANSI & Standard SQL format: yyyy-mm-dd, literals as DATE '2015-10-15' #2: This is a very generic error, you ...
403315 Oct 2015 @ 08:14 PDTDatabaseReplyREcursive processCan you show your current query?
403215 Oct 2015 @ 08:14 PDTDatabaseReplyquery to bring in multiple row values into one recordYou forgot to increase the size of the "mnemonic" column, thus it's the original size and the added lines are silently truncated: select claim_id, mnemonic (VARCHAR(1000)), line ...
403115 Oct 2015 @ 07:50 PDTDatabaseReplyLeast/Greatest Function with DatesYep, this stupid function only works with numeric & character columns. Just don't ask me why, the first time I needed it was on dates, too :-)   At least there's a workaround: ...
403015 Oct 2015 @ 07:45 PDTDatabaseReplyhow to find version of a teradata database?What does OCA mean? Oracle Ceritfied Associate? :-)
402915 Oct 2015 @ 07:41 PDTDatabaseReplyPartial string matching requires character operands#1: There's no "is like" #2: Just read the error message: "requires character operands" means "col1" is not a CHAR or VARCHAR, but probably a numeric column.

Pages