#DateForumTypeThreadPost
437813 Apr 2016 @ 12:02 PDTTeradata Database on VMWareReplyCheck partition that a query is accessing. Hi Jatan, why do you need that information? It's not available in DBQL, depending on the Select it might be a single partition or 200000, how to store it?   The Explain text found in Q...
437712 Apr 2016 @ 11:45 PDTDatabaseReplyConvert TSQL function to TeradataThere's no way to rewrite that function as a SQL-UDF. For a single calculation you might rewrite it as a Stored Procedure, but you shouldn't run this logic on a larger number of rows becau...
437612 Apr 2016 @ 11:17 PDTDatabaseReplyEphoc to teradata timestamp  case when EMP_join_date=-99 then NULL else ...  
437512 Apr 2016 @ 11:08 PDTDatabaseReplyEphoc to teradata timestampYou might simply use a NULL timestamp instead of '-99'.   DATE '1970-01-01' is used because you wrote that it's a Epoch: https://en.wikipedia.org/wiki/Unix_epoch
437411 Apr 2016 @ 09:52 PDTToolsReplyExporting CSV from TPT I don't have expertise in reading detailed TPT logs, better wait for Steve Feinholz :-)     Sending the data was only 6 seconds:   **** 15:53:11 ...
437311 Apr 2016 @ 09:17 PDTDatabaseReplyExecution modes in teradataSQLUDFs are plain SQL, there's no compiled code, thus there's no protected mode.
437211 Apr 2016 @ 09:17 PDTJobsReplyHow to reinitiatite the BTEQ after a sleep time if SQL code outputs an error?You can run a SP within a transaction, but there's no reason to pause a transaction for a minute, transactions ahould always run as fast a possible, no user interaction and no pause. 
437111 Apr 2016 @ 09:14 PDTGeneralReplyNEED HELP !! - Merging Consecutive and OVERLAPPING date spansYou can't create a view with a CTE, don't know why.     You can materialize the result using INSERT INTO target -- or CREATE TABLE newtab AS ( WITH cte...   If you&...
437011 Apr 2016 @ 05:31 PDTDatabaseReplyExecution modes in teradataWhenever you CREATE or REPLACE a C-UDF it's created in protected mode, you need to ALTER FUNCTION my_C-UDF EXECUTE NOT PROTECTED;  
436911 Apr 2016 @ 05:26 PDTGeneralReplyNEED HELP !! - Merging Consecutive and OVERLAPPING date spansYou can't nest a Common Table Expression (cte = WITH) in a Derived Table (dt = FROM (SELECT)). WITH cte(pstncd, effper) AS ( SELECT CAST(pstncd AS INT) , effper FROM cte_base ) SELECT ...
436811 Apr 2016 @ 12:57 PDTDatabaseReplymload deleteThere's a nice manual: http://www.info.teradata.com/HTMLPubs/DB_TTU_15_10/Load_and_Unload_Utilities/B035_2409_035K/2409apD.032.1.html
436711 Apr 2016 @ 12:18 PDTDatabaseReplyWill increasing block size help handle the error : The maximum possible Row length in the table is too largeHi Meenakshi, as Greenplum is based on PostgreSQL which has a much higher record size limit, so you probably need to split the table (or start normalizing it).
436610 Apr 2016 @ 11:56 PDTDatabaseReplyHow Tos to run TDExpress on VMWhat information exactly? There are no more pre-installed databases in the newer TDExpress releases, you create one and then load your own data: .logon VM.ip.address/dbc,dbc -- you shouldn'...
436510 Apr 2016 @ 11:48 PDTDatabaseReplyqualify rank() over (partition.....questionIf there's always a row per month you can simply use: SUM(travelhours) OVER (PARTITION BY State, City, Traveler ORDER BY YR-MNTH ROWS 11 PRECEDING)   And for the stat...
436410 Apr 2016 @ 11:43 PDTToolsReplyExporting CSV from TPTYou submitted a SQL Select, but used the FastExport protocol, so this is the fastest possible way. Changing the number of sessions might not help at all, because this is usually set/adjusted by Wo...
436310 Apr 2016 @ 11:09 PDTGeneralReplyNEED HELP !! - Merging Consecutive and OVERLAPPING date spansIt's working for other data types, too, but you have to define them accordingly.   For a VarChar it must be a matching definition including the chracter set: RETURNS (grpcol VARCHAR(n) ...
436210 Apr 2016 @ 11:04 PDTToolsReplyUsing Rank Numbers are getting Skipped in Teradata 13.10TD13.10 is a very old version. You need a DENSE_RANK, whihc is not supported before TD14.10, but there's a workaround see: Missing Functions: DENSE_RANK
436109 Apr 2016 @ 03:40 PDTToolsReplyExporting CSV from TPTThis is probably related to the session's DateForm setting, ansiDate returns a 10-character string 'yyyy-mm-dd'  and integerDate returns the internal 4-byte integer.   Try a...
436009 Apr 2016 @ 03:23 PDTJobsReplyHow to reinitiatite the BTEQ after a sleep time if SQL code outputs an error?REPEAT is similar to "=", both repeat a SQL statement n times, the former the follwowing the latter the preceding. They don't work with BTEQ commands like HANG.   If you creat...
435909 Apr 2016 @ 03:09 PDTDatabaseReplySplit a string parameter in a stored procedureTry STRTOK_SPLIT_TO_TABLE: http://forums.teradata.com/forum/analytics/passing-a-string-into-a-macro-for-use-in-a-in-statement#comment-147224
435809 Apr 2016 @ 03:05 PDTToolsReplyExecute Oracle's stored procedures from tptThe RANK is exactly the same in Teradata, there's just a missing table alias directly before WHERE.  Oracle allows omitting that alias, but Standard SQL requires it.
435708 Apr 2016 @ 10:54 PDTDatabaseReplySubtracting Timestamps as decimals hours As long as the difference is less than 27 years you can simply switch to  tracking_time - (max(tracking_time) over (partition by member_sk order by member_sk, tr...
435608 Apr 2016 @ 05:27 PDTDatabaseReplyHow to Add IDENTITY_COLUMN into existing table ?There's no way to add an IDENTITY column to a populated table using ALTER TABLE.   And copying 100.000.000 rows to a new table isn't that hard on a Teradata system (of course you sho...
435508 Apr 2016 @ 05:22 PDTDatabaseReplyhelp optimizing GROUP BY queryIf you only got a two-digit number of rows per PPI it should be safe to to switch to  PRIMARY INDEX (customer_id) PARTITION BY ( RANGE_N(dt BETWEEN '2000-04-01' ...
435406 Apr 2016 @ 02:01 PDTDatabaseReplyhelp optimizing GROUP BY queryStatistics will hardly help, just the estimates might be better, but the actual resource usage wil not change. In therory the fastest way should be   PRIMARY INDEX (customer_id) PARTITI...

Pages