#DateForumTypeThreadPost
205310 Jul 2013 @ 01:01 PDTDatabaseReplyCursor-Getting Error Hi Amarnath, IF( K>1000) THEN SET V_TOTAL=V_TOTAL+K;   Dieter
205210 Jul 2013 @ 12:52 PDTDatabaseReplyFull Table ScansHi Usmans, you can probably get that info from DBQL, a high "Unneccessary IO" ratio (=Higa Larry Ratio) for retrieve steps indicates lots of IO, but hardly CPU. If DBQL is ena...
205110 Jul 2013 @ 12:47 PDTDatabaseReplyHow to Calculate the total IO used by System for a particular weekDepending on the level of details it's probably Table:ResUsageSpma, View:ResGeneralInfoView and Macro:ResNode. (FileAcqReads + FilePreReads + FileWrites) is the number of IOs. Regarding Larry...
205009 Jul 2013 @ 11:57 PDTDatabaseReplyTeradata SQL?Sorry, i didn't notice it was different columns. Simply UNION ALL both selects. Dieter    
204909 Jul 2013 @ 11:49 PDTDatabaseReplySQL rewrite - Group byFirst i would simplify the calculation on LOG_TIME, why do you cast every part to a string?  CAST((log_time (FORMAT 'hh:mi:ss')) AS CHAR(8)) AS HOUR_MIN_SEC You might also avo...
204809 Jul 2013 @ 09:10 PDTTeradata ApplicationsReplyINSERT Failed. 2646: No more spool space in sinpuvAs you already noticed, 20GB is not enough to run that query, but what do you expect when you join a 120 million row fact table to several dimensions without any WHERE-condition? The query needs 1...
204709 Jul 2013 @ 08:58 PDTDatabaseReplyProblem While Joining Views: Intermediate spool being used in stead of View resultHi Sayantan the optimizer sems to think this is the best option. Could you show the query plus explain? Statistics?   Dieter
204609 Jul 2013 @ 08:50 PDTGeneralReplyReg: spool space errorAs is said, wrong datatypes in conditions plus different character sets for the same kind of information. And you don't join both fact tables on the PI columns. Based on the stats you posted&...
204509 Jul 2013 @ 08:14 PDTDatabaseReplySQL Query Performance - High Spool SpaceA Product Join involving large tables, might be due to the SQL or wrong statistics. It's hard to tell without additional information like DDL or at least PIs, row counts/statistics. And of cou...
204409 Jul 2013 @ 08:08 PDTDatabaseReplyCross tab - PivotIt's good that you found a solution on your own, but it would be nice if you could share it. Btw, your question is quite confusing, i still don't know what you actually wanted to do. &nbs...
204309 Jul 2013 @ 08:05 PDTDatabaseReplyNeed URGENT help on Update SQL tuningThere's too much code: - You don't need COALESCE for comparison, as NULL always compares to unknown - You don't need IS NULL in WHERE, this is automatically added by the optimizer - ...
204206 Jul 2013 @ 02:57 PDTDatabaseReplyStarge No more Spool Space ErrorSpool space is used for intermediate results/sorting/answer set. When you click on "Tables" a query will be submitted to retrieve that information from Teradata's system tables, eith...
204105 Jul 2013 @ 10:15 PDTGeneralReplyHow to sum up the columns total value in the last row Select case when grouping(LOB) = 1 then '' else LOB end, case when grouping(CMPGN_NAME) = 1 then '' else CMPGN_NAME end, case when grouping(INC_TRXN_CD) = 1 then 'TOTAL'...
204005 Jul 2013 @ 09:01 PDTGeneralReplyHow to sum up the columns total value in the last rowFor BTEQ don't use the column alias but the original name, i told you i didn't use it for years :-) WITH sum ( INC_AMT )  , count (*)   And for GROUPING SETS you get rid of the...
203905 Jul 2013 @ 08:19 PDTGeneralReplyHow to sum up the columns total value in the last row  If this query is run in SQL Assistant you can simply press F4 in the answer set window to get a final row with sums for all numeric columns. If this is a BTEQ script you could add a WITH S...
203805 Jul 2013 @ 08:05 PDTGeneralReplyReg: spool space errorHi Chaitanya,   you get the DDL of all tables  using a SHOW before the SELECT and stats info is returned by "HELP STATS tablename".   According to explain there ar...
203705 Jul 2013 @ 07:48 PDTDatabaseReplyFind position of a character in a stringHi Carlos, no excuses, you're welcome :-)   Of course you can use a cross join to a number table to split a string, but performance mainly depends on the defined size of the VARCHAR - c...
203605 Jul 2013 @ 07:08 PDTDatabaseReplyCASESPECIFIC What is its purpose?You set the transaction mode in the connection string: TMODE=ANSI/TERA/DEFAULT   Regarding "best mode" you should check your system's default. Most systems still use Teradata ...
203505 Jul 2013 @ 03:28 PDTDatabaseReplyNeed Help to implement recursive logic  It's hard to tell without more details, DDL, some INSERTs and the expected result. You can probably do that using WITH RECURSIVE or maybe EXPAND ON in TD13.10    Dieter
203405 Jul 2013 @ 03:25 PDTDatabaseReplyUpdate statement with left outer join in from clause.  Hi Harpreet, i don't know if this is correct, i never used an outer join for update in SQL Server. But there's no join condition on Client_GID in your original query. &...
203305 Jul 2013 @ 03:24 PDTGeneralReplyReg: spool space error  Hi Chaitanya, did you check *why* there was a no more spool space? Is the processing skewed, did the plan change or was there just an increase of rows processed? Are statistics...
203205 Jul 2013 @ 03:12 PDTDatabaseReplyGlobal Temporary Table With Multi-Level PartitioningHi Raja, it's exactly the same syntax you already use, just write CREATE VOLATILE/GLOBAL TEMPORARY TABLE :-)   Dieter
203105 Jul 2013 @ 02:50 PDTToolsReplyFast load ErrorWhich format is used to load the data? VARTEXT or DATA? In both cases DEFINE the input columns with matching datatypes (DEC(11,2) or VARCHAR(12)) and FastLoad should put those rows into the ET err...
203005 Jul 2013 @ 02:45 PDTDatabaseReplyHow to get 2 value from same id and same column?For your example (up to two rows per ID) there's a simple solution: SELECT ID, Customer, MIN(Book) || COALESCE(',' || MAX(Book), ''), SUM(Price) FROM tab GROUP BY 1, 2 ...
202905 Jul 2013 @ 02:11 PDTDatabaseReplyFind position of a character in a stringYou can modify the query i posted at http://forums.teradata.com/forum/database/stored-procedures-need-help-with-massaging-data-within-an-input-parameter WITH RECURSIVE cte (groupcol, len, ...

Pages