#DateForumTypeThreadPost
452826 Jun 2016 @ 04:29 PDTDatabaseReplyglobal parameters or variables in Teradata?You need a Stored Procedure using Dynamic SQL, Teradata simly doesn't allow a variable for TOP or SAMPLE.  
452726 Jun 2016 @ 04:22 PDTDatabaseReplyPRESERVING A SPACE IN A LIKE STATEMENTHow do you submit it? Can you show the actual WHERE-conditon?
452626 Jun 2016 @ 04:21 PDTDatabaseReplyunix timestamp with timezone to teradata timestampA Unix epoch doesn't hava a timezone, it's based on UTC.  Your timestamp simply includes milliseconds, your caluclation can be simplyfied to: -- assuming your epoch column is a BIG...
452523 Jun 2016 @ 10:53 PDTDatabaseReplyError 7547 on UpdateYou must use a defined alias instead of the original table name: UPDATE DA FROM DATABASENAME.DIG_ADOPT AS DA , (SELECT DISTINCT(CG.ACCT_NBR) FROM DATABASENAME.SRT_CG AS CG ...
452423 Jun 2016 @ 09:01 PDTDatabaseReplyError 7547 on UpdateCan you show Explain? Double check your table aliases, seems like you get a product-join.
452323 Jun 2016 @ 08:33 PDTDatabaseReplyQuery optimization issueApparently the join-conditions on ORG_ENTITY_ID are missing and you get CROSS-joins.  
452220 Jun 2016 @ 11:57 PDTGeneralReplyAssign values based on dates by groupFor each groupid? case datecol when min(datecol) over (partition by groupid) then 'initial' when max(datecol) over (partition by groupid) then 'recent' else 'inte...
452120 Jun 2016 @ 11:54 PDTUDAReplyHow to create a Macro passing table names as the parameterhttp://www.info.teradata.com/HTMLPubs/DB_TTU_15_10/SQL_Reference/B035_1148_151K/ch03.108.114.html#ww11214369   Of course you should always be aware of possible SQL Injection: https://en.wik...
452020 Jun 2016 @ 11:37 PDTDatabaseReplyRecursive Query Vs UNIONSeems like you want to return only the weeks with no negative value in the current and next week. This should be a simple task using OLAP-functions like this: select a,b,c from ( select ...
451920 Jun 2016 @ 11:08 PDTGeneralReplyHow to download and install teradata on windows 10http://lmgtfy.com/?q=teradata+express+download
451820 Jun 2016 @ 08:19 PDTDatabaseReplyDynamically select TOP N rows from table- use QUALIFY ROW_NUMBER instead of TOP - use dbc.ColumnsV instead of dbc.Columns - without ORDER BY the result is random If it's always all but the last four columns: SELECT COLUMNNAME ...
451720 Jun 2016 @ 04:07 PDTDatabaseReplyAfter Insert triggerWell, this is a website which simply copies the error descriptions from Teradata's Messages manual. http://www.info.teradata.com/HTMLPubs/DB_TTU_15_10/index.html#page/General_Reference/B035_10...
451617 Jun 2016 @ 02:43 PDTDatabaseReplyInteger to date conversionNo, PasswordDate seems to be the number of days since a start date and this start date is 307 days before Teradata's minimum date 0001-01-01.  You could also use an adjusted state date li...
451517 Jun 2016 @ 02:29 PDTDatabaseReplyDegraded Query performance while performing insertionFirst you should check the actual runtime/resource usage for each step using QryLogStepsV. The UPI on call_hist cannot be used for the join, what are the demographics for accs_meth_id, i...
451417 Jun 2016 @ 07:53 PDTDatabaseReplyError handling from DBC.SysExecSQL in my own procedureThis should work (at least with the SQLEXCEPTION hadnler), can you show the actual source code? Of course it will only drop the db, but not re-create it.   If you want to drop the database ...
451317 Jun 2016 @ 12:10 PDTDatabaseReplycalculate date errorWell, this is not Teradata related, in fact no database likes that :) When you Explain your query you'll see "unsatisfiable conditions".
451216 Jun 2016 @ 10:42 PDTDatabaseReplyInteger to date conversionI don't know who wrote those conversions originally, but it's just a slightly modified version of a astronomical julian day calculation, so you can use  DATE '0001-01-01' + ...
451116 Jun 2016 @ 10:38 PDTDatabaseReplyAlter table on huge tableComparing pros & cons of Alter, Merge, Insert/Select:   Why don't you use ALTER TABLE to alter a table?
451016 Jun 2016 @ 10:42 PDTDatabaseReply'arcmain' utility for Archiving and BackupYep, the TTU Installaton Guides seem to be missing in the 14.10 online docu, but exists for other versions: http://www.info.teradata.com/HTMLPubs/DB_TTU_15_00/index.html#page/TTU_Install/B035_3122...
450916 Jun 2016 @ 10:06 PDTDatabaseReplyTime Difference from previous rowWhen START_DTE_EVB is a DATE casting to a string with a specific format is simple, either using Teradata's FORMAT or TO_CHAR: TO_CHAR(START_DTE_EVB,'yyyy-mm-dd')   But then...
450815 Jun 2016 @ 01:41 PDTDatabaseReplyHow to group depending on number of recordsHow many groups? Based on a specific order?
450715 Jun 2016 @ 01:39 PDTDatabaseReplycreate mutiple tables from an existing table with while loopWell, the query only returns 10 CREATE TABLE statements which need to be executed. Cut&Paste them to your query window and run them.   To do that in a loop you need a Stored Procedure, ...
450615 Jun 2016 @ 01:35 PDTData ModelingReplyDoes Teradata have a probit or Normal dsitribution functionNORM.S.INV is the Cumulative distribution, there's no way to calculate an integral in SQL. A quick serach shows some solutions for SQL Server, which might be easily adopted to Teradata (lots o...
450515 Jun 2016 @ 01:24 PDTDatabaseReplyAsk help regarding to TOP, Rank and Partition Q1: yes, that's correct, you can easily test that Q2: if both time1 and time2 have a datatype TIME you can use (time1 -time2) hour to second, this will return an INTERVAL. Q3: I don'...
450415 Jun 2016 @ 01:15 PDTDatabaseReplyFastload not picking decimal valueWhat's the datatype of the target column? Seems like it's truncated to an INT.

Pages