Failure 3932 Only an ET or null statement is legal after a DDL Statement. - response (3) by ravimans
SET Vs MULTISET - response (2) by Fred
Some duplicate row checking must still be done even with a unique index, since SET table semantics call for duplicate rows to be quietly eliminated (no error thrown) in multi-row operations such as INSERT/SELECT.
Checking is done against rows with the same RowHash. Having UPI means that usually there would be no more than one row to check, so the overhead is minimal. That's not true for USI.
New to Teradata from T-SQL - response (1) by shelleybobelly
Haha I found this blog to be very helpful. Looks like you kind of have to do it in a Teradata Macro (which is like a stored proc on TSQL). Your answer is about 3/4 down. I'm in the same boat as you, only with about 17 years TSQL, so good luck to you!
http://sqlfool.com/mssql-dba-guide-to-teradata/
Access blocking for connection users - response (1) by nandalaanil
login to viewpoint as a admin user. then you can create filter for restricting perticular IP address
Transpose from columns to rows - response (1) by dnoeth
You need nested aggregrations, e.g.
select count(case when typestring = 'FE' then 1 end) as count_FTET ,count(case when typestring = 'F' then 1 end) as count_FT ,count(case when typestring = 'E' then 1 end) as count_ET ,count(case when typestring = '' then 1 end) as count_NULL from ( select -- one row per customer with a concatenated list of types Cust_ID ,max(case when Type = 'FT' then 'F' else '' end) || max(case when Type = 'ET' then 'E' else '' end) as typestring from vt group by 1 ) as dt
How SYSDATE will work if load is going more than one day - response (4) by dnoeth
Hi Moutusi,
assuming SYSDATE indicates you're using MultiLoad or TPump:
SYSDATE & SYSTIME will be the same for all rows loaded, but this is clearly mentioned in the manuals, e.g.
&SYSDATE, &SYSDATE4, &SYSTIME, and &SYSDAY reflect the time when Teradata TPump begins execution.
CURRENT_DATE/TIME/TIMESTAMP will be the same within a request, TEMPORAL_DATE/TIME/TIMESTAMP within a transaction.
Removing a line break character in a column - response (1) by dnoeth
Hi Mark,
oReplace does not automatically replace line breaks, check with CHAR2HEXINT.
But as you must remove both CR and LB you better use oTranslate(x, '0A0D'xc,'') instead.
Non duplicate row selection query - response (16) by dnoeth
Yuva's approach utllizing a hash function like SHA (but don't use HASHROW) should work.
You don't have to add it as a new column, simply calculate it on the fly concatenating all columns. The GROUP BY will use less spool than PARTITION BY:
qualify row_number() over (partition by hash_sha512(TRIM(PROCESS_DATA_MONTH) || '.' || TRIM(GEOGRAPHY_CODE) || '.' || ... order by DIRECT_ID) = 1 select * from CONSUMER_TABLE WHERE DIRCT_ID IN (select min(DIRECT_ID) from CONSUMER_TABLE GROUP BY hash_sha512(TRIM(PROCESS_DATA_MONTH) || '.' || TRIM(GEOGRAPHY_CODE) || '.' || ...)
There's an existing SHA-2 implementation, but it's not implemented for Unicode: http://forums.teradata.com/forum/extensibility/sha-2-udfs-for-teradata
DBC.Objectusage table is empty but ObjectUseCountCollectRate = 10 - response (6) by dnoeth
ON ALL will work, but do you really need it for each and every table in all databases and users?
E.g. staging tables are usually fully deleted and reloaded.
How to Skip first COLOUMN from a flatfile and load remaining columns using mload? - response (1) by dnoeth
Hi Amarnath,
simply define it as a FILLER instead of a FIELD in the LAYOUT.
DBC.Objectusage table is empty but ObjectUseCountCollectRate = 10 - response (7) by teradatauser2
There is another good post with details about usecount in case you need it -
http://developer.teradata.com/database/articles/identifying-used-unused-and-missing-statistics
-Thanks !
Samir
TARA BAM 1300: 3: System Detected Error - response (3) by teradatauser2
Hi,
I dont think there is a solution to this apart from restarting after lock is released. You dont have a "access lock" in archive. The CT as.. would take a read lock on the source table which is restrictive in nature or you can try "locking source table for access" below Ct and try.
--Samir
5464 Error: A search condition must be deterministic error while creating a join index - forum topic by Tanmoy
Hi,
I am trying to create a join index on a table based on a date range.
create join index financial.idx_cust_present_ji
as
select cust_id, c_name, city,date_spent
from financial.cust_present_1
where cast(date_spent as date format 'yyyymmdd') > '20150101';
---where extract(year from date_spent) = 2015
;
On Commit Preserve Rows taking much time - response (3) by teradatauser2
You can use below query to check data distribution on every amp. You would notice that data will not be uniformly distributed, so it takes time to create this volatile table.
sel hashamp(hashbucket(hashrow(your PI column))) as #amp,count(*)
from your_table_name
group by 1
order by 2 desc;
--Samir
Best criteria for selecting NUPI - response (6) by teradatauser2
Hi Diether,
Is it not suggested to create a PI on the sequence id and a NUSI on -
SEQID,DATA_SOURCE_ID,TIME_PERIOD,PROCESS_DATA_MONTH
.This will have a proper disstibution as well as Sec index for access. Of course the queries need to be tested if they use the SI or not and then decide ? Generally what is recomended practice in such situations.
Thanks !
Samir
Best criteria for selecting NUPI - response (7) by dnoeth
Hi Samir,
first check the FK columns (used for joins), then the columns used in Where, but defining a useless PI is the last resort.
Every relational table should have a logical Primary Key constraint, simply adding a stupid sequence still doesn't mean there's a real PK and you'll encounter duplicate rows.
And based on John's other thread Non duplicate row selection query he tries to get rid of them :-)
Failure 3932 Only an ET or null statement is legal after a DDL Statement. - response (4) by KVB
I executed like MSR not separately.
Execute a set of DDL's as a single script - forum topic by KVB
Hi All,
I have a set of DDL's where I need to execute them only all the syntaxes are correct else I dont need to execute any of the statement in the script.
I tried with MSR and came to know that it supports only DML.
What's the best approach that suits this requirement.
Any help in this regard is appreciable.
Regards
KVB
Backup - response (1) by teradatauser2
Hi ,
We had the same issue in our installation. But, we knew the reason for it. When the TD14 was upgraded, the BAR was still not upgraded and it was using a public network, so the speed was slow. After that TD GSC upgraded the BAR and moved it closer to the TD box and started using provate network, then our backups were fast, in fact faster than TD13.10. Pls check if that is a reason for you also.
--Samir
Using Case statement instead of Union - forum topic by sbadnikar
I have a table which has data like:
C1|C2|C3|C4
a|||
|b||
||c|
|d|e|
I want output like
C
---
a
b
c
d
e
I do not want to use union and tried using case statement.
CASE WHEN C1 IS NOT NULL THEN C1
WHEN C2 IS NOT NULL THEN C2
WHEN C3 IS NOT NULL THEN C3
WHEN C4 IS NOT NULL THEN C4
END
This gave me
C
---
a
b
c
d
I dont want to miss out on the value e in C3 column because C2 satisfied the condition first.
Please suggest a way to have all values in one column without using union.
KVB,
I tried the same way where i am able to run successfully. Let me know how you executed?
*** Logon successfully completed.
*** Teradata Database Release is 14.10.04.03
*** Teradata Database Version is 14.10.04.03
*** Transaction Semantics are BTET.
*** Session Character Set Name is 'ASCII'.
*** Total elapsed time was 1 second.
+---------+---------+---------+---------+---------+---------+---------+----
*** Warning: EOF on INPUT stream.
+---------+---------+---------+---------+---------+---------+---------+----
create table dbname.t
(
id integer
)
;
*** Table has been created.
*** Total elapsed time was 1 second.
+---------+---------+---------+---------+---------+---------+---------+----
create table dbname.t1
(
column1 integer,
column2 varchar(10)
)
;
*** Table has been created.
*** Total elapsed time was 1 second.
+---------+---------+---------+---------+---------+---------+---------+----
create table dbname.t2
(
column1 integer,
column2 varchar(10)
)
;
*** Table has been created.
*** Total elapsed time was 1 second.
+---------+---------+---------+---------+---------+---------+---------+----
create table dbname.t3
(
column1 integer,
column2 varchar(10)
);
*** Table has been created.
*** Total elapsed time was 1 second.
+---------+---------+---------+---------+---------+---------+---------+----
*** Warning: EOF on INPUT stream.
*** BTEQ exiting due to EOF on stdin.
*** Exiting BTEQ...
*** RC (return code) = 0