Need help on a case scenario - response (6) by rt5258
Need help on a case scenario - response (7) by dnoeth
Hi Robert,
please post unrelated questions as a new topic.
[DECIMAL(18,0), NOT NULL] is not valid in Teradata and the definition of the PK_Competitor_Identifier constraint is missing :-)
This should work:
CREATE TABLE MKTCIADB.w_Competitor ,FALLBACK ,NO BEFORE JOURNAL ,NO AFTER JOURNAL (Competitor_Identifier DECIMAL(18,0) NOT NULL title 'Competitor Identifier' ,Competitor_Name VARCHAR(50) NULL title 'Competitor Name' ,Constraint PK_Competitor_Identifier primary key(Competitor_Identifier));
Need help on a case scenario - response (8) by sujiwarrier
Yes the query will run on daily basis. Can't predict the table size at this point.
Yeah , we can include a (valid_from, valid_to) range , but it will be set for key (ID,COUNTRY) of Table1.
I have just modified the data set for table 1 with end date information also for same ID
Table1
DATED_ST DATED_END ID COUNTRY PRICE
2014-07-11 2014-07-20 1 US 10.0000
2014-07-12 2014-07-20 N/A US 50.0000
2014-07-21 9999-12-31 1 US 20.0000
2014-07-21 9999-12-31 N/A US 30.0000
Table2
DATE ID COUNTRY QTY
2014-07-20 1 US 20
2014-07-25 1 US 40
Query used : (But In this query , I am satisfying the first preference of ID and Country level price pick and second for country level price pick..Its not going for the latest price)
sel
A.DATED,
A.ID,
A.COUNTRY
,COALESCE(B.PRICE,C.PRICE)
FROM
Table2 A
LEFT OUTER JOIN
Table1 B
on A.ID=B.ID
AND A.COUNTRY=B.COUNTRY
AND A.DATED BETWEEN B.DATED_ST AND B.DATED_END
LEFT OUTER JOIN
Table1 C
on 'N/A'=C.ID
AND A.COUNTRY=C.COUNTRY
AND A.DATED BETWEEN C.DATED_ST AND C.DATED_END
Result:
DATED ID COUNTRY <Price Alone>
2014-07-20 1 US 10.0000
2014-07-25 1 US 20.0000
Actual Result looking for :
DATED ID COUNTRY <Price Alone>
2014-07-20 1 US 50.0000
2014-07-25 1 US 20.0000
error in UPDATE statement - forum topic by Cesco
Hello,
can someone tell me whats wrong in this query?
update DB_UTILS.T_TABLE_C_SIZE a
set a.TABLE_SIZE = (
select sum(b.currentperm) from tablesize b
where b.databasename = a.databasename
and b.tablename = a.tablename
)
It returns this error:
UPDATE Failed. 3706: Syntax error: expected something between '(' and the 'SELECT' keyword.
Thanks!
Need help on a case scenario - response (9) by dnoeth
You're close, you just need to add a condition, this should work:
,COALESCE(CASE WHEN B.DATED_ST >= C.DATED_ST THEN B.PRICE END, C.PRICE)
It's much easier with the included DATED_END :-)
error in UPDATE statement - response (1) by dnoeth
You probably run that on an ancient Teradata release :-)
Scalar Subqueries like this where not allowed in Updates before TD13
error in UPDATE statement - response (2) by Cesco
Hello Dieter, You are right, I'm using TD12.
I also tried to use this query:
update DB_UTILS.T_TABLE_C_SIZE t1
from
( select databasename, tablename, sum(currentperm) corrente from tablesize group by databasename, tablename ) t2
set t1.TABLE_SIZE = t2.corrente
where t1.databasename = t2.databasename
and t1.tablename = t2.tablename
but I receive:
UPDATE Failed. 3993: Illegal usage of alias name.
Do you think there is no solution in TD12?
Express 15.00.8_Sles11 worked fine for 2 weeks then "RDBMS CRASHED or SESSION RESET Recovery in progress" - forum topic by Glass
15 has bee working fine, then stopped with "CRASHED" error, I cannot logon using sqla,bteq or run any console utilities as root.
I can still open the console as Root. Pdestate is Run/Ready. I've gone through the exercise of deinstalling and restarting.
I also have 14.10 Sles 11 installed and it is still working fine.
Any help would be appreciated.
thanks,
Rglass
TPT load failure - Please suggest - response (13) by feinholz
The drivedr indicates it is from "Informatica".
Can you provide some information about that driver?
Is it DataDirect?
Also, when you indicated you used a different operator to connect after using OLE Load to create the job, which operator did you use, and do you know which driver was used in the job?
regexp_substr in TD14.10 - response (8) by td_admirer
Thank you Dieter and Vinod. This is exactly what I've wanted. Much appreciated.
Dieter,
Can you kindly tell me how you would skip the delimiter within the double-quotes in TPT. I am not aware of any parameter in TPT. Kindly help.
Thank you.
error in UPDATE statement - response (3) by CarlosAL
Hi.
Sorry for jumping in...
You cannot use alias on the 'SET' part of the UPDATE:
"set TABLE_SIZE = t2.corrente" should work
HTH.
Cheers.
Carlos.
Express 15.00.8_Sles11 worked fine for 2 weeks then "RDBMS CRASHED or SESSION RESET Recovery in progress" - response (1) by dnoeth
Hi Robert,
what's returned by pdestate -a?
And check /var/log/messages for Teradata related messages
error in UPDATE statement - response (4) by dnoeth
The syntax for UPDATE FROM is a bit strange:
UPDATE t1 FROM DB_UTILS.T_TABLE_C_SIZE t1, ( select databasename, tablename, sum(currentperm) corrente from tablesize group by databasename, tablename ) t2 SET t1.TABLE_SIZE = t2.corrente where t1.databasename = t2.databasename and t1.tablename = t2.tablename
But you should consider switching to a MERGE instead (if you specify the target PI in ON), this should be more performant:
MERGE INTO DB_UTILS.T_TABLE_C_SIZE t1 USING ( select databasename, tablename, sum(currentperm) corrente from tablesize group by databasename, tablename ) t2 ON t1.databasename = t2.databasename AND t1.TABLENAME = t2.TABLENAME WHEN MATCHED THEN update SET TABLE_SIZE = t2.corrente
TPT load failure - Please suggest - response (14) by feinholz
Ok, just verified with development.
The fix to this problem is in efix #5 (you are running with efix #4).
Please upgrade to 14.10.00.05.
Express 15.00.8_Sles11 worked fine for 2 weeks then "RDBMS CRASHED or SESSION RESET Recovery in progress" - response (2) by Glass
pdestate - a = DBS is not running
/var/log/messages
Application not started because all amps are in NewProc or Fatal State.
--the last command I ran was tpareset
regexp_substr in TD14.10 - response (9) by dnoeth
Current rleases of TPT support quoted data, you need to use following attributes for the DataConnector:
SourceFormat = 'Delimited' TextDelimiter = ',' QuotedData = 'Optional' OpenQuoteMark = '"' CloseQuoteMark = '"'
Express 15.00.8_Sles11 worked fine for 2 weeks then "RDBMS CRASHED or SESSION RESET Recovery in progress" - response (3) by dnoeth
Something killed your AMPs :-(
The reason should be somewhere in the messages, too.
I don't know if this can be fixed or you need to use a new VM, you hopefully kept the ZIP file...
Error inserting null value into nullable field using TdCommand - response (1) by NetFx
Check TdCommand.Parameters[2].IsNullable property. I think isNullable is set to false but the application is sending a DbNull to the Teradata Database; resulting in a mismatch between the parameter description (NOT NULABLE) and the parameter value (NULL).
Cannot convert from Db.DateTimeOffset to Td.TimeStampWithZone - response (1) by NetFx
You wrote
the parameter value was generated using DateTime.Now
change it to DateTimeOffset.Now.
Performance tuning - forum topic by sravan244
is there anyway we can see if particular execution step is going to finish in sometime in viewpoint or any other tool?
I am trying to creAate a tabke using the following code and am getting the erro message listed. I am new to Teradata. Please assist. Thanks in advance RT
CREATE TABLE MKTCIADB.w_Competitor
,FALLBACK
,NO BEFORE JOURNAL
,NO AFTER JOURNAL
(Competitor_Identifier [DECIMAL(18,0), NOT NULL] as 'Competitor Identifier'
,Competitor_Name [VARCHAR(50),NULL] as 'Competitor Name'
Constraint PK_Competitor_Identifier) ;
--ERROR CREATE TABLE FAILED. 3707: Syntax error, expected something like a 'CHECK' keyword or an 'UNIQUE' keyword between the word 'Competitor_Identifier' and the end of the request