#DateForumTypeThreadPost
1727 Nov 2012 @ 01:18 PSTDatabaseReplySpool Space error...please help to optimizeTry the below query:   SELECT DISTINCT A.USER_ID, C.SUPER_NM_LVL2 AS SUP, C.SUPER_NM_LVL1 AS AD, DIR.SUPER_NM_LVL2 AS DIR, A.ACTIVITY_DT, B.MTN, A.ACCT_NUM, A.PPLAN_CD_CURR FROM (SE...
1611 Nov 2011 @ 01:43 PSTDatabaseTopicHow to delete the record from the base table with foreign key mapping Hi,   Consider a table A with 3 columns. 1st column is the primary key, 2nd column is a foreign key mapped from table B. Now if some deletions happen in table A, certainly some...
1503 Oct 2011 @ 02:53 PDTDatabaseReplyDate logic for SQL If I am not wrong the Last Date for all the previous employees will be holding some value since they are no longer part of the company. For the current and future employees last date will be nul...
1403 Oct 2011 @ 02:43 PDTDatabaseTopicDeleting data from both Parent and underlying foreign key related tables at same time Hi,   Is there any way to delete data from parent as well as the underlying tables which are assosiated with foreign key relation??
1322 Sep 2011 @ 11:52 PDTGeneralReplyBTEQ Error Handling in Unix You can define a variable to capture the return code of any command/job executed just after calling it. You can add below code after calling bteq: export rc=$? here rc captures the r...
1222 Sep 2011 @ 09:54 PDTDatabaseReplyAny advice to increase efficiency of my query? Yes, I agree with Manik. If you are doing a join on Huge table, it is better to write a subquery fetching only the required columns on unique combination. Or creating a derived table from it. Th...
1119 Sep 2011 @ 05:24 PDTJobsReplyTeradata DBA with good knowledge of ETL and shell scripts Please mention which location and which company? I have good experience in ETL and Shell scripting.
1019 Sep 2011 @ 04:22 PDTDatabaseReplyGenerating Test Data in Teradata You can do these but you need to have all the test data for the required fields in a file. You can do these through BTEQ IMPORT or through Teradata SQL Assistant by using the import option. ...
919 Sep 2011 @ 04:18 PDTDatabaseReplyTakes up cpu! One way is to put subqueries to pull the required fields data from the table in hte FROM clause instead of joining the entire table. You have 23 tables being joined and there might be some tabls...
819 Sep 2011 @ 04:08 PDTDatabaseReplyWhich of the following query will be good in performance?? Both the given queries perform different operations. In your first query you are extracting chng_flag value based on the data obtained after joining the 2 tables. But where is this operation...
719 Sep 2011 @ 04:08 PDTDatabaseReplyQry very sloww! Here you are doing a select * on whole query output. Since only first table it being left outer joined with all other tables, after the first left outer join it will actually try to do a cartesi...
619 Sep 2011 @ 03:39 PDTDatabaseTopicHow to get all the dbc.% tables in Teradata Is there any way to know what are all the dbc.% tables present in Teradata. I know only few dbc tables in teradata. Is there anyway to know this?
519 Sep 2011 @ 03:29 PDTDatabaseReplyHelp with Bteq IMPORT Better option would be to run the test file in loop (in the platform on which you are triggering bteq) and call bteq import inside the loop.  
418 Sep 2011 @ 11:29 PDTDatabaseReplyTesting environment changes What is the platform you are using to trgger teradata? Is it Unix or someting else? If unix you have a parameter 'hostname' which gives you the environment server on which it is trig...
318 Sep 2011 @ 11:25 PDTDatabaseReplynamed subqueries in Teradata? You can give names in Teradata for subqueries or columns in select clause, called as Alias Names. Query syntax is something like this: sel a.fld1,b.fld2 from (sel * from tbl1) a, ...
217 Sep 2011 @ 02:26 PDTDatabaseReplyAdding a date filter Query would look something like this:   sel New_Date, Sum(CASE WHEN Offer_1 = 'Y' THEN 1 ELSE 0 END) as Offer1, Sum(CASE WHEN Offer_2 = 'Y' THEN 1 ...
117 Sep 2011 @ 02:23 PDTDatabaseReplyDynamic Table creation Whatever may be the number of columns user selects but is it not predefined like user will be able to see only these number columns on the screen from where he has to select some n number of col...