#DateForumTypeThreadPost
377820 Jun 2015 @ 02:37 PDTDatabaseReplyHow to Prevent SQL Injection in TeradataSimply use parameters instead of Dynamic SQL.
377720 Jun 2015 @ 02:36 PDTToolsReplyReceiving Failure 2673 The source parcel length does not match data that was defined while importing using BTEQHi Malli, when you define VARTEXT all fields in USING must be VARCHARs: using dno (VARCHAR(11)), dname(VARCHAR(200)), eno(VARCHAR(11))  
377615 Jun 2015 @ 02:48 PDTGeneralReplyChanging display/format of Teradata SQL Assistant Result#1: Tools - Options - Export - Uncheck "Write column headers to the export file" #2: use TO_CHAR to change the format to 'HH24MI' #3: ??? This question doesn't parse :-) #4...
377515 Jun 2015 @ 02:43 PDTDatabaseReplytime stamp field insert Hi John,   in TD14 you can utilize Oracle's TO_TIMESTAMP: TO_TIMESTAMP(x, 'YYYY-MM-DD.HH24.MI.SS.FF6') But both Teradata and Oracle don't support a single digit month, s...
377415 Jun 2015 @ 02:17 PDTDatabaseReplySQL to get first day of month and last day of month but for 2 months agoIn TD14 simply use LAST_DAY and TRUNC: TRUNC(ADD_MONTHS(CURRENT_DATE,-2),'mon') -- first day of month two months ago LAST_DAY(ADD_MONTHS(CURRENT_DATE,-2)) -- last day of month two mo...
377312 Jun 2015 @ 02:30 PDTTeradata StudioReplyTeradata procedure double quotesNo, that's fine, as I said, this should run as-is. I was just assuming it might have been caused by sessions with different client character sets...
377212 Jun 2015 @ 10:23 PDTTeradata StudioReplyTeradata procedure double quotesYour syntax is correct and should work as-is. Did you run the CALL in the same session as the CREATE?
377112 Jun 2015 @ 10:19 PDTDatabaseReplyDynamic calling of stored procedure.Hi Mahesh, there's no way to do what you want in a procedure. The only workaround is CASE SP_NAME WHEN 'StoredProcedure1' THEN CALL StoredProcedure1(DB_NAME,TBL_NAME); W...
377012 Jun 2015 @ 10:15 PDTDatabaseReplyVolatile table creation issue within Stored procedureHi Nik, you can't select from any kind of table in a Stored Proc.  You need to use cursor-syntax: DECLARE c CURSOR WITH RETURN ONLY FOR SELECT * FROM Test_Zemp; OPEN c; http://ww...
376912 Jun 2015 @ 10:10 PDTDatabaseReplyConverions of timestamp to FORMAT 'MM/DD/YYYYBHH:MI:SS'Hi Nirav, Teradata doesn't seem to like the time in between month and year. But you can utilize TO_DATE or TO_TIMESTAMP: TO_DATE(s, 'dy mon dd hh:mi:ss YYYY')  
376812 Jun 2015 @ 10:04 PDTGeneralReplyFinding a substring between two pointsSwitch the square to round brackets: REGEXP_SUBSTR(fullurl ,'(?<=\?(page|shop)_id\=)(.*?)(?=\&)' ,1 ,1, 'i')  
376711 Jun 2015 @ 10:00 PDTDatabaseReplyCollect stats taking long timeRe-collecting stats is not done automatically, there's usually an automated process for it. In your case this seems to be done based on "dbadmin_procs.Stats_Log" which is not provide...
376611 Jun 2015 @ 09:53 PDTGeneralReplyFinding a substring between two pointsYou just need to change a slash to a backslash: regexp_substr(field_text ,'(?<=\?page_id\=)(.*?)(?=\&)' ,1 ,1, 'i')  
376510 Jun 2015 @ 02:47 PDTDatabaseReplyTO_DATE in "IN" clauseDon't ask me why, but Teradata doesn't allow any kind of calculation or function within IN.
376410 Jun 2015 @ 02:35 PDTDatabaseReplyHow to convert the flat procedure to set logic?Hi Vincent, your cursor/loop logic can be replaced by a single cross join, you just need a table with numbers from 1 to the maximum possible value of "multiplier".  CREATE TABLE ...
376309 Jun 2015 @ 02:30 PDTDatabaseReplyNeed to update a column values into NULL if the value contains a non numeric values. TD14 supports TO_NUMBER which returns NULL if the conversion fails: select to_number(col)
376209 Jun 2015 @ 11:37 PDTDatabaseReplyHow to convert the flat procedure to set logic?What's your Teradata release? Can you show some actual data? This seems to simply create rows for each month/quarter/etc based on a startdate. You should be able to do this either using a CR...
376106 Jun 2015 @ 02:28 PDTDatabaseReplyhelp in Transpose rows to columnsHi Samir, by default only dbc has access to tdstats, but you might also use XMLAGG when XML-services are installed, see this post:  http://forums.teradata.com/forum/database/convert-a-c...
376005 Jun 2015 @ 01:59 PDTDatabaseReplyImport Null ValuesThere's no automatic compression for NULLs.  The stored value will be probably zero for numeric column, spaces for Chars and an empty string for Varchar.
375905 Jun 2015 @ 01:17 PDTGeneralReplyI am newbie to this forum, I would like to get Teradata Demo DVD?There's no demo DVD, you can download a fully functional virtual machine running Teradata on VMware
375805 Jun 2015 @ 01:15 PDTDatabaseReplyDelete and Drop Select Tables via MacroYou need Dynamic SQL to do pass object name. So this is only possible using a cursor in a Stored Procedure.
375705 Jun 2015 @ 01:13 PDTDatabaseReplyMacro - SELECT WITH GRANT OPTION access error Hi Jimmy, you need to grant those rights including GRANT OPTION to the database DB1.
375605 Jun 2015 @ 01:12 PDTGeneralReplyadd microsecond field to timestamp fieldHi Srini, try start_time + duration_microseconds * interval '0000 00:00:00.000001' day to second
375505 Jun 2015 @ 01:10 PDTConnectivityReplyTeradata .NET data provider - LEFT() function doesn't work in both V13.x and V14.x of SQL Assistant? Hi Chris, LEFT is no valid Standard/Teradata SQL syntax, it's an ODBC function, it will not work in .NET or CLI. In fact the ODBC driver simply replaces it with SUBSTR (but only in DML, e.g. ...
375405 Jun 2015 @ 08:35 PDTTeradata ApplicationsReplyWhy TPT is successful with return code 0, even when records goes to ET table?Hi Chandu, yes, but this was exactly the same problem for FastLoad, it didn't change with TPT.

Pages