#DateForumTypeThreadPost
2314 Apr 2016 @ 09:53 PDTDatabaseReplyNeed suggestions to write a date logic Select CASE WHEN (Day_Of_Week =1) then (ADD_MONTHS(Current_Date,-3) + 1)  WHEN (Day_Of_Week =2) then (ADD_MONTHS(Current_Date,-3) + 2)  ELSE ADD_MONTHS(Current_Date,-3) END Fr...
2213 Apr 2016 @ 01:29 PDTDatabaseReplyConvert MINUS query to OUTER JOIN Create multiset volatile table VT1_1 (Inx Varchar(20)) on commit preserve rows; Create multiset volatile table VT2_2 (Inx Varchar(20))  on commit preserve rows; Insert into VT1_1 ...
2113 Apr 2016 @ 12:42 PDTDatabaseReplyConvert varchar to date data type Create volatile multiset table Temp1 (Id Int, DTE Varchar(10) ) on commit preserve rows; Insert into Temp1 (1, '1' ); Insert into Temp1 (2, '2/2/11'); Insert into Temp1 (...
2004 Feb 2016 @ 04:09 PSTDatabaseReplyLogon credentials in BTEQ script not workingcheck if your login mechanism is LDAP n include it .LOGMECH LDAP;
1921 Jan 2016 @ 04:13 PSTDatabaseReply2616: Numeric overflow occurred during computation.Is the MAX() query working fine without a 2616 error? May be you may need to consider a CAST() statement there too, depending on the underlying column (& the Data).
1821 Jan 2016 @ 11:19 PSTDatabaseReply2616: Numeric overflow occurred during computation. You may look for any calculations. Assuming your datatype in ques is Integer. Below are the ranges for Int datatypes. If you cross these limits, you can get a 2616. Small Int: -32,768 to 3...
1720 Jan 2016 @ 10:15 PSTDatabaseReplyNeed regular expression to identify records Select Case when Character_length( Oreplace ('string start ########      this_is_a_record.sh      ######## strng end', '#####...
1614 Jan 2016 @ 01:19 PSTDatabaseReplyNeed help to implement the logic SELECT oldVal.Id, OldVal.Priority AS OldValue, NewVal.Priority AS NewValue FROM (SELECT ID,Priority FROM (SELECT Id,Priority, RANK () OVER (PARTITION BY ID ORDER BY Audit_TS) Rnk1 FROM <...
1514 Jan 2016 @ 10:38 PSTDatabaseReplySelect all text after specific characterAnother alternative could be 'STRTOK' function. SELECT STRTOK('TEST@ABC.COM','@',1) will give you the LEFT of @ & SELECT STRTOK('TEST@ABC.COM','@',2) wi...
1414 Jan 2016 @ 09:40 PSTDatabaseReplycount distinct values suing olap approachYou ONLY have to use OLAP approach? If not, you may try something like below.   Select A.Col1, A.Col3, B.Cnt from (Sel Col1, col3, col4 from <Tbl>)A, (Sel Col1, Count(distinct(Col2) ...
1312 Nov 2015 @ 01:44 PSTDatabaseReplyStored Procedure Dependencies I meant NOT PRESENT*
1212 Nov 2015 @ 01:43 PSTDatabaseReplyStored Procedure Dependencies Try to include "SQL SECURITY INVOKER" at the beginning of the SP. SQL Securty invoker will give a warning during compilation for any dynamic sqls that are present in db. Something like t...
1112 Nov 2015 @ 10:43 PSTDatabaseReplyIssue with Trigger definitionHi, Its a TD session. But I am not sure which session was used during the Trigger compilation originally.   Thank you! Ranga  
1009 Nov 2015 @ 03:00 PSTDatabaseTopicIssue with Trigger definitionHi, I am using TD 14.10. I ran into a bizzare issue the trigger definitions. Below are the sequence of events. 1. Drop trigger DB.TRIG 2. Sel  * from dbc.triggersv where triggername = ...
909 Nov 2015 @ 12:16 PSTDatabaseReplyhow to create view definition using DBC tables??You can get the col names from the dbc.columnsV joining with the DBC.TablesV. Generate 2 Ranks. 1. based on Columnid in the asc order 2. based on Columnid in the desc order Use a case...
816 Sep 2015 @ 03:53 PDTDatabaseReplyRecords are getting skipped in MloadWhy dont you try writing the rejects in Datastage to a temporary file and see?
716 Sep 2015 @ 03:48 PDTDatabaseReplyStored procedure runs in SQL assistant but given error when triggered through InformaticaAnother point to consider is the SESSION MODE between Informatica and SQL Assistant. Make sure the session is TERADATA and not ANSI.
616 Sep 2015 @ 02:27 PDTDatabaseReplyError code: 3610 - Internal error, please do not submit the last request. Subcode, Crashcode:0,2693 Yeah. I have done that already. But in the meanwhile wanted to check if there is any chance of knowing what could be the possible issue using the Crashcode(2693).    
514 Sep 2015 @ 04:25 PDTDatabaseTopicError code: 3610 - Internal error, please do not submit the last request. Subcode, Crashcode:0,2693 Hi, While compiling a Stored procedure I got this error msg. When I connected a new session, I was able to compile without any issues? Is it something to do with my session spool space? &n...
410 Sep 2015 @ 06:31 PDTDatabaseReplythe value applied to a Teradata 8 byte decimal was out of range -- 9.223372036854775808E18Are you trying to load only the decimal precision? Please double check the definition - its (20,20) & you have a digit '9' before the decimal pt.
328 Aug 2015 @ 04:22 PDTDatabaseReplyStored procedures problemBest way to debug these dynamic sql's would be to move them to an Output variable before calling the DBC.SysExecSQL statement. Anyways, coming to this query, looks like the issue is with the s...
228 Aug 2015 @ 03:57 PDTDatabaseReplyMethod to find number of occurence of specific character in a stringHi, You can try the below: Sel character_length('Teradata is Relational Database') - character_length(Oreplace('Teradata is Relational Database','a','')); -- will...
109 Mar 2015 @ 03:04 PDTGeneralTopicIs Null conditions in ON (Join) Vs. Is Null in WhereHi,  Here are my sample tables.  Table A Col1 Col2 Col3 1 A ABC 2 B ABD 3 C ADC Table B Col1 Col2 Col3 1 A ABC 2 B ABD   Query 1 Select * from ...