#DateForumTypeThreadPost
3925 Jun 2008 @ 07:38 PDTToolsReplyCapturing the return code of bteq in shell variablebteq << EoF.logon xxxxx....quit 23EoF_Ret=$?echo $_Ret
3818 Jun 2008 @ 12:32 PDTDatabaseReplyEmail ValidationSomething like that : select MAIL_ADDRESS || " is not valid"from MY_TABLEwhere MAIL_ADDRESS like any ('.%', '@%', '%.', '%@') and MAIL_ADDRESS not like '%@%.%'
3712 Jun 2008 @ 10:24 PDTDatabaseReplyFew basic queriesYou can't directly extract week no or quarter no directly form a timestamp but you can use a join on CALENDAR_DATE in CALENDAR table and get WEEK_OF_{MONTH|YEAR|CALENDAR} and QUARTER_OF_{YEAR|CALEN...
3612 Jun 2008 @ 10:17 PDTDatabaseReplycan we use max function in case statement?You can use analytics group functions :INSERT INTO table1 ( amt )SELECT CASE WHEN t2.amt = MAX(t2.amt) OVER() THEN 0 ELSE t2.amt ENDFROM tabl...
3512 Jun 2008 @ 10:14 PDTDatabaseReplycan we use max function in case statement?You can use analytics group functions :INSERT INTO table1 ( amt )SELECT CASE WHEN t2.amt = MAX(t2.amt) THEN 0 ELSE t2.amt ENDFROM table2 AS...
3412 Jun 2008 @ 10:02 PDTDatabaseReplyAVG(date_column) overflowYou could use CALENDAR view :SELECT cal.calendar_date AS avg_dateFROM sys_calendar.calendar AS cal INNER JOIN ( SELECT AVG(cal.day_of_calendar) AS avg_day FROM ...
3320 May 2008 @ 11:05 PDTDatabaseReplyTo capture the return code in BTEQtry that :.run file logon.txt.if errorcode > 0 then .quit 255your bteq return code will be 255 if login fails
3220 May 2008 @ 10:57 PDTDatabaseReplyTranspose using Dynamic SQLTwo ways to answer your problem :select empid , sum(exp1) as exp1 , sum(exp2) as exp2 , sum(exp3) as exp3 , sum(exp4) as exp4from ( select empid , su...
3120 May 2008 @ 10:54 PDTDatabaseReplyTranspose using Dynamic SQLTwo ways to answer your problem :
3020 May 2008 @ 10:35 PDTDatabaseReplyColumn to Rowyou could use a recursive select
2911 Apr 2008 @ 07:37 PDTDatabaseReplyvariables in BteqA simple way to have pseudo-variables in a bteq script is to use temporary tables...[Code]CREATE VOLATILE TABLE mypseudovarAS SELECT myexpr AS varname FROM myfirstrequestWITH DATA;SELECT var.myvar,...
2821 Mar 2008 @ 11:42 PDTAnalyticsReplyHelp Please, working with AVGAre you sure about your code ?I don't see any reference to A or B alias in the WHERE clause.
2721 Dec 2007 @ 10:34 PSTToolsReplyExtracting time from timestamp to insertYou can use CAST and EXTRACT on any expression, not only columns values...
2612 Oct 2007 @ 06:19 PDTDatabaseReplycreation of procedureDid you try this ?INSERT INTO my_table (my_column)VALUES(:num_line);... See you later on developpez ;-)
2531 Aug 2007 @ 06:27 PDTDatabaseReplystring to timestamp(0) convesionAnd how do you know 2007 is better than 1907 ?You surely have a way to choose it : a condition.I would just use a CASE :SELECT chardate (FORMAT 'mm/dd/yyBhh:mi:ssBT') + CASE WHEN condition THEN INT...
2417 Jul 2007 @ 09:10 PDTDatabaseReplySize Limit of Fast Export?Found in "Teradata Fastexport Reference"On UNIX MP-RAS operating system, the maximum file size thatis supported by the FastExport utility is 2 gigabytes.On Windows, Solaris SPARC, AIX, and HP-UX op...
2325 Jun 2007 @ 06:10 PDTToolsReplybteq.exe - entry point not foundSearch for terasso.dll on your PATH directories.Surely you'll find an old version of this DLL in a system folder.Delete or rename it and retry ...
2208 Jun 2007 @ 08:04 PDTDatabaseReplyPerformance of Not Exists and Exists over Not IN and IN operatorsCompare then EXPLAIN plans of the "same" request with IN or EXISTS to see de differences...
2101 Jun 2007 @ 06:55 PDTDatabaseReplyDynamic sql, putting a char in ''Try this :' AND Ti_period_rep_id = ''' || v_ti_period_rep_id || '''';
2024 May 2007 @ 07:05 PDTDatabaseReplyViews or Intermediate objects that can hold dataJOIN INDEX in Teradata give you something equivalent to materialized views in Oracle...
1903 May 2007 @ 09:58 PDTAnalyticsReplyRounding up to whole numberUse that expression : cast((((End_Date - Start_Date) / 7) + 1) as integer)
1819 Apr 2007 @ 11:19 PDTToolsReplyCreating a new Table...with [no] datawith no data : creates only the structurewith data : creates the structure and insert lines from the SELECT query
1719 Apr 2007 @ 08:10 PDTToolsReplyNeed to read date field from table in BTEQYou need two bteq scripts inside your Unix shell script :# Prepare the tmp.sh script and get the run_date valuebteq
1618 Apr 2007 @ 11:41 PDTToolsReplyPlease Need Help as soon as possible.Do you have the same business problem ?http://www.teradata.com/teradataForum/shwmessage.aspx?ForumID=1&MessageID=7157
1518 Apr 2007 @ 07:37 PDTUDAReplyJoining two tablesSomething like that ?select T1.EMP_ID , T1.SPL_EVENT_DATE , T1.NAME , T1.ADRESS , T2.REVISED_MONTHLY_SALARYfrom TABLE_1 as T1 inner join TABLE_2 as T2 on T...

Pages