#DateForumTypeThreadPost
417815 Feb 2016 @ 07:53 PSTDatabaseReplyExpression for the last day of the month based on Accounting Period*Existing report*, what reporting tool? Do you need to do the calculation within the tool or using Teradata SQL? Is this based on the actual date? E.g. if the user selects "period 2" to...
417714 Feb 2016 @ 04:50 PSTDatabaseReplyPPI Dropping/Adding PartitionsYou can't DROP/ADD/MODIFY a CASE_N-partitioning (unless the table is empty).
417613 Feb 2016 @ 04:42 PSTDatabaseReplyObtain the text of a join index from the data dictionary? SELECT * FROM dbc.JoinIndicesV returns the DatabaseName/TableName for both the JI and it's base tables.  
417513 Feb 2016 @ 04:28 PSTDatabaseReplychar(23) to timestamp(6)Hopefully this is done during load, you should store timestamps in a string. If you got different formats you must a CASE to match each possible format: CASE WHEN x LIKE '____-__-__ %&#...
417412 Feb 2016 @ 10:46 PSTConnectivityReplyODBC ts time stamp for now()I don't know exactly about ODBC, but {ts 'now()'} is definitely wrong, this tries to convert the literal 'now()' into a timestamp, imho this should be {fn now()} instead.
417312 Feb 2016 @ 10:41 PSTGeneralReplyTeradata Driver][Teradata Database] Invalid operation for DateTime or Interval.That's an Oracle query, of course it fails on Teradata, date/time handling is totally different. Is this trying to adjust timezones? And comparing timestamps using TO_CHAR is very strange. Yo...
417211 Feb 2016 @ 01:06 PSTDatabaseReplyCalculation of prescription drug adherenceArgh, I simplified the query and didn't double check. Change this line ,CAST((INTERVAL(pd) DAY) AS INT) -- days within range to ,CAST((INTERVAL(pd_in_range) DAY) AS INT) -- days wit...
417111 Feb 2016 @ 10:41 PSTDatabaseReplyCalculation of prescription drug adherenceHi Brent,  you're running a Teradata version where you have to list all columns of a CTE (afaik before TD15), sorry for that: WITH RECURSIVE cte ( Person -- must list all columns...
417011 Feb 2016 @ 09:35 PSTDatabaseReplyWrong Statistic Estimations of Optimizer Teradata 14.10?If the value is within the range of known values but not one of the exactly known values the optimzer does this average calculation based on that specific interval CEILING(OtherRows / OtherVal...
416911 Feb 2016 @ 08:19 PSTDatabaseReplyHow to join minus function in query.MINUS is a set operator, you need a simple calculation: select item, saledate, max(orgprice-sprice) from ( select * from trnsact qualify -- earliest date where the sale price...
416811 Feb 2016 @ 05:47 PSTDatabaseReplyCalculation of prescription drug adherenceHi Brent, that's a nice puzzle :-)   First I thought that it would be possible to solve with OLAP-functions, but I didn't find a solution . As it's based on dat...
416710 Feb 2016 @ 12:30 PSTDatabaseReplyWrong Statistic Estimations of Optimizer Teradata 14.10?Hi Roland, the optimizer never fully trusts stats :-) It seems to think that the user has a better knowledge and this value might exists, thus it's assuming the average number of rows per val...
416610 Feb 2016 @ 12:11 PSTDatabaseReplyExtract VS INTERVALA WHERE-condition should be sargable (https://en.wikipedia.org/wiki/Sargable), there should be no function/calculation applied to a column. Better move the calculation to the BETWEEN: where ...
416510 Feb 2016 @ 08:20 PSTDatabaseReplyHow to define an array of varchars in Stored Procedure Language?I think you found a bug :)   I just checked the actual SQL submitted in dbc.QryLogV: ...TD_SYSFNLIB.ARRAY_AGG ( token , NEW array_strings ( ), tokennum , '1') FROM TABLE(TD_SYSFNLIB...
416410 Feb 2016 @ 08:00 PSTToolsReplyHow to change a date column to show only month and yearRunning your code you will notice that it return the next to last day of the previous month.   You probably meant DATE - EXTRACT(DAY FROM DATE)+1, but this is a bit less efficient (two time ...
416310 Feb 2016 @ 02:46 PSTDatabaseReplyHow to define an array of varchars in Stored Procedure Language?I just checked it, for SQL SECURITY DEFINER (which is the default) it runs fine when you create the SP within your own user and fails when it's in a different database. For SQL SECURITY OW...
416209 Feb 2016 @ 02:27 PSTDatabaseReplyBTEQ Export - Odd File OutputBTEQ REPORT is fixed width out for direct printing. Switching to TPT would really simplify this, FILE_WRITER plus Format = 'DELIMITED' :-)
416109 Feb 2016 @ 10:02 PSTDatabaseReplyHow can I get details of C and JAVA UDFs from my Teradata server?The only way is a SHOW [SPECIFIC ]FUNCTION xxx
416009 Feb 2016 @ 09:55 PSTUDAReplyConverting a string to Timestamp and checking if it has valid timestampIn TD15.10 there's a new TRYCAST function, which returns NULL for invalid data, but it doesn't accept a FORMAT: TRYCAST(col AS TIMESTAMP(6))  
415909 Feb 2016 @ 09:52 PSTDatabaseReplyCREATE SYSTEM TIME TABLE in errorHi Pierre, no, works in both ANSI and BTET mode.
415809 Feb 2016 @ 09:09 PSTDatabaseReplyHow to define an array of varchars in Stored Procedure Language?- The C-functions to access arrays are ment to be used in a C-UDF only (which would be better suited to do logic in complicated loops than SQL).   - STRTOK_SPLIT_TO_TABLE can be used on...
415709 Feb 2016 @ 08:10 PSTDatabaseReplyMerge Error  5758 The search condition must fully specify the Target table primary index and partition column(s) and expression must match INSERT specification primary index and partition column(s). ...
415609 Feb 2016 @ 07:49 PSTDatabaseReplyCREATE SYSTEM TIME TABLE in errorHi Pierre, ANSI Temporall was introduced in TD15 and you're running TD14.10 :-)
415509 Feb 2016 @ 07:48 PSTUDAReplyConverting a string to Timestamp and checking if it has valid timestampThere's no built-in function to check if a string holds a valid timestamp, you might need to create a C-UDF or a really complicated SQL-UDF.
415409 Feb 2016 @ 07:45 PSTTeradata ApplicationsReplyHow to install Teradata on UBUNTUTeradata runs on SLES only, no other Linux distro is officially supported. It's just starting another VM, what's so hard about it?  On a real Teradata you're not going to ins...

Pages