3078 | 01 Sep 2014 @ 08:14 PDT | Tools | Reply | TPT scripting: Escaping characters in Atribute fields | I can't test it right now, but I would assume you need to double the single quotes within the string:
VARCHAR OsCmd = 'awk -F "[/,]" ''NR>1{printf("%s,%s,%s,%02... |
3077 | 01 Sep 2014 @ 08:04 PDT | General | Reply | USING DDMMYYYY INSIDE DBC.SYSEXECSQL() in Stored Procedure | Hi Arun,
you pass a string to SysExecSQL, so you need double any single quote within your string:
CALL DBC.SYSEXECSQL('Select CAST( (Event_Date (FORMAT ''YYYYMMDD'') ) AS C... |
3076 | 01 Sep 2014 @ 05:13 PDT | Database | Reply | Calculation Precision issue Oracle Vs Teradata | Hi Ankit,
Teradata rounds after every step based on the precision of the datatypes.
There's a rule of thumb, multiply first, then divide, but in your case this will not help:
SELECT 23.88 ... |
3075 | 30 Aug 2014 @ 04:23 PDT | Database | Reply | My perception on EXPLAIN was wrong | Hi Cheeli,
this is not a runtime error like "numeric overflow", it's simply based on the internal processing of a query: syntaxer -> resolver -> security check -> query rewr... |
3074 | 30 Aug 2014 @ 02:47 PDT | Database | Reply | Copy the record and increment in its one column | You are close :-)
Cross join to a list of numbers between 1 and 15:
insert into tab
select tab.col1,tab.col2,tab.colx + n
from tab cross join
( -- get numbers from 1 to 15
select top ... |
3073 | 29 Aug 2014 @ 01:43 PDT | Database | Reply | Format with leading zeros | Simply padding with leading blanks can be done with a FORMAT:
'A' || CAST(acct_id AS FORMAT '9(6)')
|
3072 | 29 Aug 2014 @ 07:41 PDT | Tools | Reply | Mload error: RDBMS failure: 2644, No more room in database abc | Seems like this is failing when the LogTable should be created.
Check the available perm space of abc (on an AMP level, not with a SUM) or qualify it with a different database.
|
3071 | 29 Aug 2014 @ 07:33 PDT | UDA | Reply | Problem Using UPSERT | This error message simply means that you're updating the PI or partitioning if the target table, which is not allowed in an UPSERT (or MERGE).
5565 The UPDATE specified in the UPSERT statem... |
3070 | 29 Aug 2014 @ 07:29 PDT | Database | Reply | QUERY CHALLENGE - FIND CUSTOMERS WHO HAVE SPECIFIC PRODUCTS | Hi Slice,
the outer WHERE filters for customers with either product 11 or 12 and the subquery removes them if they got any other product.
|
3069 | 29 Aug 2014 @ 07:27 PDT | Tools | Reply | Fast load Vs Mload when AMP is down | A table without Fallback is destroyed when an AMP looses data.
|
3068 | 29 Aug 2014 @ 07:09 PDT | Database | Reply | CASE Statement error please help | You need to rewrite the IN to a Correlated Subquery. And you can remove the IS NOT NULL, because NULs never compare equal:
SEL A.*,
CASE WHEN CUST_NM = CC_Lookup
THEN CASE WHEN CUS... |
3067 | 28 Aug 2014 @ 12:18 PDT | Connectivity | Reply | .NET data provider - cant see in visual studio | AFAIK the .NET Data Provider is not in T@YS, it's published via DevEx only:
.NET Data Provider
|
3066 | 28 Aug 2014 @ 10:24 PDT | Database | Reply | QUERY CHALLENGE - FIND CUSTOMERS WHO HAVE SPECIFIC PRODUCTS |
SELECT * FROM tab AS t1
WHERE prod_id IN (11,12)
AND NOT EXISTS
(
SELECT * FROM tab AS t2
WHERE t1.cust_id = t2.cust_id
AND t2.prod_id NOT IN (11,12)
);
SELECT cu... |
3065 | 28 Aug 2014 @ 05:20 PDT | Database | Reply | Calling Stored Procedures from Dynamic SQL Statement | Hi Thomas,
check the SQL Stored Procedures and Embedded SQL manual.
There's a section named SQL Statements that Cannot Be Used Dynamically and CALL is one of them.
|
3064 | 28 Aug 2014 @ 04:29 PDT | Tools | Reply | Looking for command line versions Teradata Parallel Transporter (TD ->streaming->SQL) | Hi Joop,
I never did this, but you should be able to use a DataConnector as consumer with an OLEDB Access Module.
Check the Job Example 13: Export Data and Process It with an Access Module in the... |
3063 | 27 Aug 2014 @ 09:53 PDT | Database | Reply | Identifying GTT or volatile tables created during a session | Materialized GTT within your session are listed in dbc.AllTempTablesVX
|
3062 | 27 Aug 2014 @ 04:20 PDT | Database | Reply | Defining two derived tables using WITH clause ?? | This should work:
INSERT INTO target
WITH cte ....
SELECT * FROM cte
|
3061 | 27 Aug 2014 @ 03:08 PDT | General | Reply | SAMPLE WITH REPLACEMENT | Just have a look at the manuals:
http://www.info.teradata.com/HTMLPubs/DB_TTU_14_00/index.html#page/SQL_Reference/B035_1146_111A/ch01.032.249.html
|
3060 | 26 Aug 2014 @ 02:22 PDT | Database | Reply | ROLLING 12 MONTHS | I don't understand what you mean.
Using CURRENT_DATE automatically changes the result every month.
|
3059 | 26 Aug 2014 @ 02:14 PDT | Database | Reply | Rows to Column (Column-delimited) | Wrap the query in a Derived Table and add a ROW_NUMBER:
SELECT TRIM(ROW_NUMBER() OVER (ORDER BY ACCOUNT#, rn) (FORMAT'9(4)')) || ','
|| TRIM(ACCOUNT#) || ',' || txt
... |
3058 | 26 Aug 2014 @ 09:25 PDT | Database | Reply | Syntax error expected something like a name between ',' and the 'LE' keyword | The only way to use a keyword as a column name is double quoting it: "le"
You should check if there's a setting in Informatica to automatically enclose object names in d... |
3057 | 26 Aug 2014 @ 07:58 PDT | Database | Reply | Defining two derived tables using WITH clause ?? | Replace the 2nd WITH with a comma:
WITH TEMP_TAB(a,b,c)
AS
(Select
a,b,c
from table)
,TEMP_TAB2(a,x,y)
AS
(Select
a,x,y
from table)
Sel derived_columns from TEMP_TAB inner join TEMP... |
3056 | 26 Aug 2014 @ 03:44 PDT | Database | Reply | Determine status on a given date | The error message tells exactly what's wrong:
KEY is a keyword, if there's actually a column named key in your table you must use double quotes: "key"
... |
3055 | 25 Aug 2014 @ 12:30 PDT | Database | Reply | Special Characters | Hi John,
of course there is, it's called UPDATE :-)
update tab
set col = oTranslate (col, '0D0A'xc,'')
where col <> oTranslate (col, '0D0A'xc,'')
&n... |
3054 | 25 Aug 2014 @ 10:15 PDT | Database | Reply | Special Characters | Hi John,
CHAR2HEXINT returns a string of digits, so you can't use oTranslate.
'0D0A' is a Windows carriage return/linebreak combination, simply use oTranslate(col, '0D0A'... |