Quantcast
Channel: Teradata Forums - All forums
Viewing all 27759 articles
Browse latest View live

OLAP-Unbounded Following query - response (2) by Sai088

$
0
0

Thank you for clarification Dieter


Compression in Teradata - forum topic by rithu

$
0
0

Hi experts,
I am getting a spool error while inserting records from one table to another of similar structure expect for one column where table 1 has a column with char(50) and  some 63 compression values
and table 2 has same column with char(120) with 63 compression values.(here I made sure that maximum column size here to be 7560 bytes)
 
When i tried inserting values using query insert into tab2 select top 1 * from tab1 I am getting no more spool space error.
 But I am not getting this error when tab2 has the same column datatype as that of tab1 as char(50)
Please help.
 
 
 
 
 
 
 
 
 
 

Forums: 

How to correctly use JPA + eclipselink + java - forum topic by Den

$
0
0

Please tell me how teradata interacts with Java in the implementation of JPA. When meping two classes where a one-to-many an error:
[EL Config]: metadata: 2013-03-06 11:39:10.038--ServerSession(4212265)--Thread(Thread[main,5,main])--The access type for the persistent class [class com.test_log.log.Packet] is set to [FIELD].
[EL Config]: metadata: 2013-03-06 11:39:10.054--ServerSession(4212265)--Thread(Thread[main,5,main])--The target entity (reference) class for the one to many mapping element [field files] is being defaulted to: class com.test_log.log.File.
[EL Config]: metadata: 2013-03-06 11:39:10.054--ServerSession(4212265)--Thread(Thread[main,5,main])--The access type for the persistent class [class com.test_log.log.File] is set to [FIELD].
[EL Config]: metadata: 2013-03-06 11:39:10.054--ServerSession(4212265)--Thread(Thread[main,5,main])--The target entity (reference) class for the many to one mapping element [field packet] is being defaulted to: class com.test_log.log.Packet.
[EL Config]: metadata: 2013-03-06 11:39:10.054--ServerSession(4212265)--Thread(Thread[main,5,main])--The alias name for the entity class [class com.test_log.log.Packet] is being defaulted to: Packet.
[EL Config]: metadata: 2013-03-06 11:39:10.069--ServerSession(4212265)--Thread(Thread[main,5,main])--The alias name for the entity class [class com.test_log.log.File] is being defaulted to: File.
org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl@1271a80
[EL Severe]: ejb: 2013-03-06 11:39:10.303--ServerSession(4212265)--Thread(Thread[main,5,main])--java.lang.NullPointerException
Exception in thread "main" javax.persistence.PersistenceException: java.lang.NullPointerException
    at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:602)
    at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.getDatabaseSession(EntityManagerFactoryDelegate.java:186)
    at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.createEntityManagerImpl(EntityManagerFactoryDelegate.java:278)
    at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:304)
    at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:282)
    at com.test_log.log.Main.main(Main.java:18)
Caused by: java.lang.NullPointerException
    at java.util.ResourceBundle.getBundle(Unknown Source)
    at org.eclipse.persistence.exceptions.i18n.ExceptionMessageGenerator.buildMessage(ExceptionMessageGenerator.java:47)
    at org.eclipse.persistence.exceptions.ValidationException.errorDecryptingPassword(ValidationException.java:873)
    at org.eclipse.persistence.internal.security.JCEEncryptor.decryptPassword(JCEEncryptor.java:124)
    at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.updateLogins(EntityManagerSetupImpl.java:1817)
    at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.updateSession(EntityManagerSetupImpl.java:2121)
    at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:523)
    ... 5 more
Give an example of eclipselink + java + teradata (JPA). Or documentation with an example. And another question why no plugin for Eclipse teradata operating system Windows 7 x64.

Forums: 

row concatenation for dummies? AKA oracle wm_concat() teradata equivalent - response (8) by Jessy Mahesh Kothapalli

$
0
0

Hi Team,
 
Please suggest me how to hanle multiple grouping statements in recursive function. Please let me know as soon as possible
we (Me and ashish Patil ) are eagerly awaiting for your valuable replay

Concatenate o/p of two select statements - response (14) by Jessy Mahesh Kothapalli

$
0
0

 
RECURSIVE function logic
 
createmultisetvolatiletable tb1
(id integer
,nm varchar(5)
)  
primaryindex (id,nm) 
oncommitpreserve rows;
 
 
insertinto tb1 values (10,'xy');
insertinto tb1 values (10,'yz');
insertinto tb1 values (10,'zx');
insertinto tb1 values (20,'ab');
insertinto tb1 values (20,'bc');
 
 
createmultisetvolatiletable tb3
as
(
sel id,nm,rank () over (partitionby id orderby nm) rn1
from
tb1
) withdataprimaryindex (id,nm) oncommitpreserve rows;
 
 
withrecursive rslt (id,nm,rn1,lvl)
as(
sel id,cast ( nm  as varchar(20)),rn1,0 as lvl
from
tb3
where
rn1 = 1
unionall
sel
rslt.id,
rslt.nm || ',' ||b.nm,
b.rn1,
rslt.lvl +1 as lvl
from
tb3  b
innerjoin
rslt
on
rslt.id = b.id
where
rslt.rn1 < b.rn1
)
 
 
 sel id,nm
 from rslt
 qualify rank() over (partitionby id  orderby lvl desc ) = 1;
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Above logic used for only single grouping colum.
If we use multiple grouping statements for same, it will NOT be concatenated , Please see which we’ve written logic for multiple grouping
-----------------------Logic which we've written---------------------------------
CREATEMULTISET  TABLE OLAP_DEV.TB1
(
 DEALER_WID   DECIMAL(10,0)
, DIVN_WID  DECIMAL(10,0)
, EVTLOC_WID  DECIMAL(10,0)
, MONTH_WID   DECIMAL(10,0)
, MM_WID  DECIMAL(10,0)
,EVENT_NAME   VARCHAR(2000)
)
 
 
 
INSERTINTO TB1
SELECT * FROM WC_EVENT_MM_A_TEST;
 
SELECT * FROM TB3
CREATEMULTISETTABLE TB3
AS
(
SEL DEALER_WID,DIVN_WID, EVTLOC_WID,MONTH_WID,MM_WID, EVENT_NAME,   RANK () OVER (PARTITIONBY DEALER_WID,DIVN_WID, EVTLOC_WID,MONTH_WID,MM_WID ORDERBY EVENT_NAME) RN1
FROM
TB1
)
WITHDATA;
 
 
 
WITHRECURSIVE RSLT (DEALER_WID,DIVN_WID, EVTLOC_WID,MONTH_WID,MM_WID, EVENT_NAME,RN1,LVL)
AS(
SEL DEALER_WID,DIVN_WID, EVTLOC_WID,MONTH_WID,MM_WID,CAST ( EVENT_NAME  AS VARCHAR(1000)),RN1,0 AS LVL
FROM
TB3
WHERE
RN1 = 1
UNIONALL
SEL
--RSLT.ID,
RSLT.DEALER_WID,
RSLT.DIVN_WID,
RSLT.EVTLOC_WID,
RSLT.MONTH_WID,
RSLT.MM_WID,
TRIM(RSLT.EVENT_NAME) || ',' ||TRIM(B.EVENT_NAME),
B.RN1,
RSLT.LVL +1 AS LVL
FROM
TB3  B
INNERJOIN
RSLT
ON
--RSLT.ID = B.ID
RSLT.DEALER_WID=B.DEALER_WID
AND RSLT.DIVN_WID=B.DIVN_WID
AND RSLT.EVTLOC_WID=B.EVTLOC_WID
AND RSLT.MONTH_WID=B.MONTH_WID
AND RSLT.MM_WID=B.MM_WID
WHERE
RSLT.RN1 < B.RN1
)
 
 
 SEL DEALER_WID,DIVN_WID, EVTLOC_WID,MONTH_WID,MM_WID, EVENT_NAME
 FROM RSLT
 QUALIFY RANK() OVER (PARTITIONBY DEALER_WID,DIVN_WID, EVTLOC_WID,MONTH_WID,MM_WID  ORDERBY LVL DESC ) = 1;
 
this logic is not working when we are using multiple grouping values.
Please help me out from this situation!
 
Thanks in advance
 
 
Eagerly awaiting  

Stats collection inside SP's - response (5) by Adeel Chaudhry

$
0
0

BEGIN and END period data-types are the specific types that Temporal table uses to manage history.
 
HTH!

Data From Vendor Changes - response (2) by Adeel Chaudhry

$
0
0

The scenario requires a complete documentation on the format of the file and possible cases to cater for. What is seems is the example of complex structured file containing interrelated data in seperate rows.
 
OR
 
Actually usable file format, if the column doesnt have a value, yet it needs to be specified in the file you get .... hence the number of commas in the file for every row should be same.

Issue during Conversion of varchar to Timestamp(0) - response (2) by Adeel Chaudhry

$
0
0

Sample data would help .... but it seems to be a FORMAT issue.


Can we access a table from SQL UDF in TD 14? - response (5) by Adeel Chaudhry

$
0
0

For the correct way o implement that .... again .... What will be the use of this fuction?

Need of Collect Statistics - response (9) by Adeel Chaudhry

$
0
0

Collection of unnessasary stats does have a downside, but considering your scenario, it shouldnt be an issue.
 
Moverover, it is always an evolving thing to come up with the best possible stats to collect. So, its better to analyze for a time-being and then tweak, add or remove stats.
 
HTH!

How to optimize the query? The Explain plan is given below. Its showing no more spool space. - response (1) by Adeel Chaudhry

$
0
0

Whats the skewnes of underlying tables?

CommandTimeout issue - forum topic by Pradeep207

CommandTimeout issue - response (1) by Pradeep207

$
0
0

I am using .Net data provider for Teradata 13.0 and I am facing a strange issue. I am unable to execute an update statement through TdCommand which is usually taking 90sec if I run from Sql Assistant . Its throwing CommandTimeout exception even If I set timeout value to 600sec. Can somebody help me out ?
 
Thanks,
Pradeep

How to optimize the query? The Explain plan is given below. Its showing no more spool space. - response (2) by dnoeth

$
0
0

1st step: rewrite the NOT IN to NOT EXISTS (rule of thumb: try to avoid NOT IN as much as possible)
And the logic is quite complex, did you check if it could be simplified? The base table is always the same.
Dieter
 

Stats collection inside SP's - response (6) by barani_sachin

$
0
0

Thanks Adeel :) So that doesnt have anythign to do with Stats collection inside a SP??
Also could someone pls elaborate on what can i do regarding the error
"CALL Failed. 3598:  STATS_CHECK:Concurrent change conflict on database -- try again. "


Stats collection inside SP's - response (7) by dnoeth

$
0
0

You should check the QueryLog which transactions were running in parallel.
Collect Stats is first using an Access lock and after the collection it's merging the new info, but i would rather expect a "3603 Concurrent change conflict on table".
Do you get this error every time or randomly?
Dieter

Stats collection inside SP's - response (8) by barani_sachin

$
0
0

@Dieter : I get this same error all the time!!! I am sure that no query is trying to access this VT.

Stats collection inside SP's - response (10) by barani_sachin

$
0
0

PFB the simple SP which is throwing the above mentioned error! 

replace procedure db.proc() sql security creator
begin
declare uname varchar(100);
declare stmt1 varchar(1000);
select current_user into uname;
create volatile table temp ,NO FALLBACK, NO JOURNAL, NO LOG (name varchar(10)) on commit preserve rows;
CALL dbc.sysexecsql ( 'COLLECT STATISTICS '|| uname ||'.temp COLUMN name;');
end;

call db.proc();

 

why mload accepts duplicates and why dont fastload - response (3) by barani_sachin

Stats collection inside SP's - response (11) by dnoeth

$
0
0

I don't know the exact reason, but it seems to be based on the combination of the security option and the dynamic SQL when a different user calls the SP.
When you change SECURITY to OWNER and use "COLLECT STATS temp COLUMN name;" instead of sysexecsql it seems to work.
Dieter

Viewing all 27759 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>