#DateForumTypeThreadPost
27328 Jun 2011 @ 05:58 PDTGeneralReplyconfusion about using BETWEEN keyword for characters.Last Name will be selected if the last name begins with "r" or the last name is "s" followed by spaces. This is because the 'r' and 's' constants in your between are expanded to the same size as la...
27220 Jun 2011 @ 10:27 PDTDatabaseReplyusing UDF with TPTIf you want one single quote within a string, just use two. So: 'Insert into table1 values ( nvl(:column, ''replacement string''));'
27119 Jun 2011 @ 01:06 PDTViewpointReplyGetting the role of the current userDBC.Users contains the default rolename for any user. When a user logs on, a record is created for every session in DBC.SessionInfo - this also contains the username and rolename for that session....
27014 Jun 2011 @ 11:16 PDTGeneralReplyRestarting Mload delete job.It is, but there is a write lock on the table at that point. You need to use an access lock on your read operation.
26912 Jun 2011 @ 10:52 PDTDatabaseReplyNUSI subtable distributionNUSI entries are located on the same AMP as the base row. For this reason, access via NUSI is always an all amps operation. See Database Design, Secondary Indexes.
26808 Jun 2011 @ 12:20 PDTGeneralReplyMULTILOAD CONSTRAINTSMultiload cannot handle records which span vprocs. If a table has a NUSI defined, the index entry for that record is on the same vproc as the record itself. If the table has a USI, the index entry...
26702 Jun 2011 @ 05:55 PDTDatabaseReplyHow many bytes a unicode character set takes?On the Teradata server, Unicode characters are held as UTF-16 - each character occupies 2 bytes. So in your case, NAME will occupy two bytes for the length and two bytes for each character. The fie...
26601 Jun 2011 @ 02:40 PDTToolsReplyBteq Import, Delete Statement on same table at once causing deadlockSorry, that should have been ERRORCODE. Rollback will cause anything from the BT to be backed out of the database and restored to a state as it was whe the BT was issued. The message 'Operation ...
26531 May 2011 @ 06:48 PDTToolsReplyHow to test Checkpoints in FastLoadFastload does not load records directly into the target table during the acquisition (first ) phase. It puts them into a subtable; when it encounters an END LOADING it then moves them from the subt...
26431 May 2011 @ 06:33 PDTToolsReplyBteq Import, Delete Statement on same table at once causing deadlockYou need to ensure your delete and inserts all occur within a BT/ ET block and that the table is locked throughout the process. So: .Retry Off BT ; Locking Tbl1 for Write ; Delete From Tbl...
26327 May 2011 @ 02:43 PDTDatabaseReplyPerformance problem with insert in TD 13.0Yes - define a usable primary index on the target table. If the primary index on the target has very few values, insert to a Set table will be very slow. Inset to a Multiset table is MUCH quicker ...
26227 May 2011 @ 02:39 PDTDatabaseReplyDoes NULL actually acquire any bit of memory in Teradata or in anyother database?1. If a column is not compressed, then space is used for that column whether the value is null or not. So of the column spec is Char(20), 20 character are used by that column regardless of the valu...
26122 May 2011 @ 09:12 PDTDatabaseReplycount(*)Select Sum(Case When D1.TblName = 'TableA' Then TblCount End) As TableA , Sum(Case When D1.TblName = 'TableB' Then TblCount End) As TableB From (Select 'TableA' As TblName, Count(*) As TblCou...
26022 May 2011 @ 06:49 PDTDatabaseReplyAn Bteq Error Code return issue.Need HelpIt is in an environment variable called errorlevel. See: http://stackoverflow.com/questions/334879/how-do-i-get-the-application-exit-code-from-a-windows-command-line
25921 May 2011 @ 08:38 PDTGeneralReplyBTEQ Export to override existing fileDelete the file before from within bteq before your export command: .os rm exportfile .export data file = exportfile where exportfile is the path and filename of your data file.
25820 May 2011 @ 02:04 PDTDatabaseReplyTrimming Inner SpacesThe replace function does not rexist on Teradata. There is an oreplace UDF available on the Teradata website. See : http://downloads.teradata.com/download/extensibility/teradata-udfs-for-popular-...
25713 May 2011 @ 05:55 PDTToolsReplyRecord count from worktable in mloadMultiload locks the work table for Write. If you want to look at it during the load, use an Access Lock. Locking wt_tabl1 For Access select Count(*) from wt_tabl1; :-)
25613 May 2011 @ 05:42 PDTDatabaseReplyUpdate Set by SubqueryUse a standard ANSI update :- UPDATE u_ukul_martdb.LB_MORE_BL_Price_Incentive a SET Date_Accnt_Closed = u_ukul_martdb.LB_MORE_BL_accepts.rejection_date Where a.Cust_num = u_ukul_martdb.LB_M...
25512 May 2011 @ 02:57 PDTToolsReplyHow to load formatted file ( with indicator bits) using bteqImport Indicdata will do it. I would normally specify the Not Null against appropriate columns, but it looks like you can get away without it. .import indicdata file= d:bteqtestorg.txt .Repe...
25412 May 2011 @ 02:09 PDTDatabaseReplyBuilding heirarchal answerset from single tableYou do not need a recursive query for this - just use a Join. Create Table OrgHier (User_Id Smallint Not Null , First_Name Varchar(20) Not Null , Last_Name Varchar(30) Not Null , Super...
25312 May 2011 @ 01:44 PDTToolsReplyMLOAD DELETE vs MLOAD Import with Delete statementA MLoad DELETE task deletes records using a full table scan (normally a fairly high percentage of the table). It is normally used for removing aged records or removing all records for a business un...
25208 May 2011 @ 03:47 PDTDatabaseReplySelect records from previous week based on current dateWeek To Date ------------------ Select * From MyTab MyT Where MyT.Dt in (Select D.Calendar_Date From Sys_Calendar.Calendar D Join (Select Max(C.Calendar_Date) As ST_Monday -- The Mond...
25106 May 2011 @ 04:38 PDTGeneralReplyHow to recovert Teradate Query from Windows StandbyBy way of explanation, when you rebooted your system, the IP connection was reset. When you restarted Teradata, your Teradata session was discarded because the IP session was reset; any updates bac...
25006 May 2011 @ 03:56 PDTAnalyticsReplyPercentile on MS Excel vs TeradataSelect Max(Vals) From (SEL "Value", PERCENT_RANK() OVER(ORDER BY "Value") PER_VAL FROM T1) As A Where Per_Val LE 0.5 ; I suggest you try with a couple more examples, but looks OK to m...
24906 May 2011 @ 12:12 PDTDatabaseReplySelect records from previous week based on current dateSelect * From MyTab MyT Where MyT.Dt in (Select D.Calendar_Date From Sys_Calendar.Calendar D -- all days of last week Join (Select Max(C.Calendar_Date) As ST_Monday -- The Monday of las...

Pages