replacing existing column - forum topic by SGIT
Hello, In the below query, i get the error CREATE TABLE Failed. 3515: Duplication of column PRCD_AMT in a table, derived table, view, macro or trigger. I understand that is cause i am doing...
View ArticleDBC Diskspace, - forum topic by Dinesh1975
We have load jobs running in the night. DBC diskspace getting filled rapidly. I can see it in the view point, it raises from 11% to 80 %. or some time it reaches 100 % and all the jobs get failed. My...
View ArticleDBC Diskspace, - response (1) by Fred
Most likely, this is due to WAL space (DBC.TransientJournal) holding uncommited insert / update / delete information, in case a transaction aborts. Perhaps you need to commit / checkpoint more...
View ArticleDBC Diskspace, - response (2) by Fred
Or maybe DBC is simply sized too small for your workload. What fraction of total system PermSpace is DBC MaxPerm?
View ArticleI can't execute an SP that calls another SP inside - response (1) by Fred
GRANT EXECUTE PROCEDURE ON novaquality.F_QUITA_REPES TO database_containing_calling_procedure; (Or GRANT on the entire database instead of the individual SP.)
View ArticleDECLARE - forum topic by erics44
/*com 021 mi*/ DECLARE Var_EmployeeID INTEGER;Hi I am new to the forum so hello all :) i am from a sql server background so just finding my feet with teradata ive writen the above code and i get a...
View ArticleI can't execute an SP that calls another SP inside - response (4) by juanalfonso
Thanks a lot! It has worked! GRANT EXECUTE PROCEDURE ON novaquality TO novaquality; I never thought I would have to give permissions to the database to execute its own procedures... So if you just...
View ArticleALTER STATEMENT - IF THE TABLE HAVE MORE THAN ONE BILLION RECORDS - forum...
Hi, I am Altering the table for addition of new columns. And tables is having more than 1 billion records. Please let us know is it standard to alter the table with more than one billion records or...
View Articlebetween condition make bad execution plan - response (7) by knowledge
the result is 5041, the exclusion is irrelevant. for the outer questions, i don't know the reply, i have to talk with the development enviroment."The product join result of all the combinations seems...
View ArticleDECLARE - response (1) by sachin.sebastian
You can define of parameter variables in Macors, Stored procedures and utilities such as Fastload, Mload etc. You cannot 'DECLARE' a variable outside of these. What are you trying to achieve by...
View Articlereplacing existing column - response (1) by sachin.sebastian
You can create the all_apps2 same as all_apps1 and write an update statement for prcd_amt Or you could just use 'HELP TABLE all_apps1' to get the column list and copy paste it in the Select statement...
View Articlereplacing existing column - response (2) by SGIT
Thanks Sachin. I will go with the second option as then I can do it all in one query.
View ArticleALTER STATEMENT - IF THE TABLE HAVE MORE THAN ONE BILLION RECORDS - response...
You can have a look to the DNOETH's blog. It's very interesting http://developer.teradata.com/blog/dnoeth/2013/08/why-dont-you-use-alter-table-to-alter-a-table
View ArticleI can't execute an SP that calls another SP inside - response (5) by Fred
For CREATE / REPLACE PROCEDURE, the CREATOR must have permission to execute any DML statements within the procedure (including CALL). But the OWNER (database in which the procedure is defined) must...
View ArticleCreating a Dynamic YoY Date Range in Case Statement for Current Quarter QTD -...
You can apply TRUNC & TO_CHAR like this: CASE WHEN date between TRUNC(CURRENT_DATE-1, 'Q') AND CURRENT_DATE-1 THEN TO_CHAR(CURRENT_DATE-1, '"Q"Q"_"yyyy') WHEN date between...
View ArticleInsert taking long - response (2) by krishna1985
Hi Dieter, thanks I will try to make all tables as multiset and will try to make another column as Primary Index. Thanks Sir..
View ArticleGrouping while combining Date and Hour - forum topic by mrjkirkpatrick
Hello, I couldn't find exactly this question among the great date/time posts on the forum. I have a date field (row_added_ts) with the format: "12/29/2014 6:34:42 PM" My end goal is to group 'cases' by...
View ArticleGrouping while combining Date and Hour - response (1) by dnoeth
The easiest way is to group by two columns:CAST(row_added_ts AS DATE), EXTRACT(HOUR FROM row_added_ts) You can also cast to a string, but your format will not allow correct...
View ArticleDBC Diskspace, - response (4) by dnoeth
Wow, less than 1 percent for dbc, that's definitely way too low. What's the % perm space in use?
View ArticleTeradata block storage - forum topic by pandit
Hi All, This is my first post :). So pardon me in case of any mistake. I have been reading the teradata storage architecture in detail. Recently found very interesting article explaining how a row is...
View ArticleSql to delete duplicates in Teradata - response (17) by ak.sabale@gmail.com
Hi...."How to remove duplicate more than one records from given table. table as tbl1 emp_id,emp_fname,emp_lname 1,a,b 2,a,b 2,a,c 3,c,b 3,f,h i want output like 2,a,c 3,c,b 3,f,h Thanks in Advance !
View ArticleGrouping while combining Date and Hour - response (2) by mrjkirkpatrick
Thank you, very helpful. Grouping by the two columns does seem easiest, though I'll try the other options as well.
View ArticleMerge into operation - response (6) by Soumyatg
Thanks Saeed and Carlos for the clarification. I was comparing an insert against a merge into and it appeared that while CPUTime for Merge(with only when not macthed clause) was less, the spool usage...
View ArticleOLAP SQL - running count/total - forum topic by deven_rk
Hi All, We have the below data and using an SQL not procedural code, I would like to get the output as given below for 'out_count', it would help if we could do it using OLAP functions with Preceding...
View ArticleHow to return the result of a select query in a function - forum topic by...
Hello to everybody, I'm trying to return the result of a select query in a function. Something like: REPLACE FUNCTION F_SIGUIPUNTERO_F (nPunt number, nLimite number) RETURNS int LANGUAGE SQL CONTAINS...
View ArticleOLAP SQL - running count/total - response (1) by nealvenna
Below is the solution and answer is inspired from Dieter Answer from the link below https://forums.teradata.com/forum/database/olap-function-csum-sum-with-reset-value select cal_date,...
View ArticleTeradata block storage - response (1) by ToddAWalter
The rows in the data blocks are not sorted, they are just placed at the end of a heap of storage. The block contains an index list though which is ordered by the rowid. Likewise the blocks are not...
View ArticleCreating a Dynamic YoY Date Range in Case Statement for Current Quarter QTD -...
Thank you Dieter this works!
View ArticleSyntax - forum topic by SGIT
I am getting the following error : SPL1027:E(L7), Missing/Invalid SQL statement'E(3706):Syntax error: expected something between the word 'StartDate' and the 'DATE' keyword.'. Looks like a syntax error...
View ArticleFind blocking sessions and tables - forum topic by teradatauser2
Hi, In our environment, we have an application that runs queries and they block each other for some tables. I want to know which all sessions and which all tables are in blocked state with that ID? i...
View ArticleFind blocking sessions and tables - response (1) by teradatauser2
I see the values as blk3objdbid = 1 and blk3objtid = 102, screenshot attached
View ArticleFind skew with perm over 1gb - forum topic by vc
Hello, I am using the below query SELECT cast(DatabaseName as char(30)), cast(Tablename as char(40)), (100 - (AVG(CURRENTPERM)/MAX(CURRENTPERM)*100) (FORMAT 'zz9.99') )AS Skewfactor_greater_90, cast...
View ArticleFind skew with perm over 1gb - response (1) by AtardecerR0j0
SELECT cast(DatabaseName as char(30)), cast(Tablename as char(40)), (100 - (AVG(CURRENTPERM)/MAX(CURRENTPERM)*100) (FORMAT 'zz9.99') )AS Skewfactor_greater_90, cast (CURRENT_date as timestamp(0)) +...
View ArticleSystem Table for Compression - forum topic by agts
Is there any way for finding compressed columns in database with there values, like system table for compression columns and values? using Select * from dbc.columns where compressible like 'C%'; I can...
View ArticleSystem Table for Compression - response (1) by agts
got it. CompressValueList in dbc.columns can be use for same
View ArticleDrop Table blocked by Read lock session which is not on the machine. - forum...
Hi All,I having an issues, while Dropping a backup table, The drop tables session(Session ID 59678567) is blocked by read lock of some other session (2463583 USER: ALL), this blocking is not even...
View ArticleTeradata block storage - response (2) by pandit
Thanks a lot for the reply Todd. It was really helpful. Just to revise, say on block level, data will be just apended to blocks whereas the index will be in sorted order for performing binary search....
View ArticleCollect Stats with insert statement - forum topic by Aganediwal
Hi all, I am using below two statements to create table and insert some data from an existing table. Is there a way in which stats will be automatically collected after insert statement completes or a...
View ArticleCompute with immediate previous row value derived - forum topic by deven_rk
Hi All, I have the below data, wherein I want to compute 'Amount' data dynamically in a 'Select' statement as given below, here I want to refer the previous row value, apply an equation, compute a new...
View ArticleCompute with immediate previous row value derived - forum topic by deven_rk
Hi All, I have the below data, wherein I want to compute 'Amount' data dynamically in a 'Select' statement as given below, here I want to refer the previous row value, apply an equation, compute a new...
View ArticleTeradata block storage - response (3) by ToddAWalter
Correct. The row index list is just a set of offsets from the beginning of the block rather than a pointer but the effect is the same.
View ArticleFind blocking sessions and tables - response (3) by teradatauser2
Could anyone please help me on this ? --samir
View ArticleCompute with immediate previous row value derived - response (1) by...
Let say your table has first record (2016-11-01, 1000) then you can run the below SQL once everyday which will calculate new Amount and insert it into the same table. INS into dbname.Amt_tbl Sel...
View ArticleFind blocking sessions and tables - response (4) by abhishek.jadhav
You can use following functions to map the ids to names IdentifyTable IdentifyDatabase dbid=1 is for DBC tid=102 is for AccessRights table
View Articlevolatile tables inside the stored procedure - forum topic by SGIT
Hello, I have the following two questions please: 1) While creating a volatile talbe inside a stored procedure : it needs to be created first outside the SP and then again inside. I am doing this...
View ArticleCompute with immediate previous row value derived - response (2) by dnoeth
Your calculation is similar to 1000 * 1.1 ** (row_number() over (order by Date)-1) To get he start value you might trymin(Amount) over () * 1.1 ** (row_number() over (order by Date)-1) or...
View ArticleFind blocking sessions and tables - response (5) by teradatauser2
Thanks Abhishek, it works.
View ArticleCollect Stats with insert statement - response (1) by abhishek.jadhav
A third statement for collecting stats is required.
View Article