3778 | 20 Jun 2015 @ 02:37 PDT | Database | Reply | How to Prevent SQL Injection in Teradata | Simply use parameters instead of Dynamic SQL.
|
3777 | 20 Jun 2015 @ 02:36 PDT | Tools | Reply | Receiving Failure 2673 The source parcel length does not match data that was defined while importing using BTEQ | Hi Malli,
when you define VARTEXT all fields in USING must be VARCHARs:
using
dno (VARCHAR(11)),
dname(VARCHAR(200)),
eno(VARCHAR(11))
|
3776 | 15 Jun 2015 @ 02:48 PDT | General | Reply | Changing 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... |
3775 | 15 Jun 2015 @ 02:43 PDT | Database | Reply | time 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... |
3774 | 15 Jun 2015 @ 02:17 PDT | Database | Reply | SQL to get first day of month and last day of month but for 2 months ago | In 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... |
3773 | 12 Jun 2015 @ 02:30 PDT | Teradata Studio | Reply | Teradata procedure double quotes | No, 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...
|
3772 | 12 Jun 2015 @ 10:23 PDT | Teradata Studio | Reply | Teradata procedure double quotes | Your syntax is correct and should work as-is.
Did you run the CALL in the same session as the CREATE?
|
3771 | 12 Jun 2015 @ 10:19 PDT | Database | Reply | Dynamic 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... |
3770 | 12 Jun 2015 @ 10:15 PDT | Database | Reply | Volatile table creation issue within Stored procedure | Hi 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... |
3769 | 12 Jun 2015 @ 10:10 PDT | Database | Reply | Converions 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')
|
3768 | 12 Jun 2015 @ 10:04 PDT | General | Reply | Finding a substring between two points | Switch the square to round brackets:
REGEXP_SUBSTR(fullurl ,'(?<=\?(page|shop)_id\=)(.*?)(?=\&)' ,1 ,1, 'i')
|
3767 | 11 Jun 2015 @ 10:00 PDT | Database | Reply | Collect stats taking long time | Re-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... |
3766 | 11 Jun 2015 @ 09:53 PDT | General | Reply | Finding a substring between two points | You just need to change a slash to a backslash:
regexp_substr(field_text ,'(?<=\?page_id\=)(.*?)(?=\&)' ,1 ,1, 'i')
|
3765 | 10 Jun 2015 @ 02:47 PDT | Database | Reply | TO_DATE in "IN" clause | Don't ask me why, but Teradata doesn't allow any kind of calculation or function within IN.
|
3764 | 10 Jun 2015 @ 02:35 PDT | Database | Reply | How 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 ... |
3763 | 09 Jun 2015 @ 02:30 PDT | Database | Reply | Need 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)
|
3762 | 09 Jun 2015 @ 11:37 PDT | Database | Reply | How 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... |
3761 | 06 Jun 2015 @ 02:28 PDT | Database | Reply | help in Transpose rows to columns | Hi 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... |
3760 | 05 Jun 2015 @ 01:59 PDT | Database | Reply | Import Null Values | There'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.
|
3759 | 05 Jun 2015 @ 01:17 PDT | General | Reply | I 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
|
3758 | 05 Jun 2015 @ 01:15 PDT | Database | Reply | Delete and Drop Select Tables via Macro | You need Dynamic SQL to do pass object name.
So this is only possible using a cursor in a Stored Procedure.
|
3757 | 05 Jun 2015 @ 01:13 PDT | Database | Reply | Macro - SELECT WITH GRANT OPTION access error | Hi Jimmy,
you need to grant those rights including GRANT OPTION to the database DB1.
|
3756 | 05 Jun 2015 @ 01:12 PDT | General | Reply | add microsecond field to timestamp field | Hi Srini,
try
start_time + duration_microseconds * interval '0000 00:00:00.000001' day to second
|
3755 | 05 Jun 2015 @ 01:10 PDT | Connectivity | Reply | Teradata .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. ... |
3754 | 05 Jun 2015 @ 08:35 PDT | Teradata Applications | Reply | Why 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.
|