803 | 15 Sep 2010 @ 10:53 PDT | Database | Reply | null handling in substr built in function | Oracle does not distinguish between a zero-length VARCHAR string and NULL, this is a well-known Oracle bug/feature :-)
And Oracle's SUBSTR has different rules, e.g. for negative start positions.... |
802 | 09 Sep 2010 @ 08:10 PDT | Database | Reply | How to find the Continious records based on Key column. | Hi Amit,
looks like you don't want gaps, you want to densify the data:
SELECT grp, MIN(start_dt), MAX(end_dt)
FROM
(
SELECT
grp, start_dt, end_dt,
SUM(flag) OVER (PARTITION BY grp ORDER... |
801 | 09 Sep 2010 @ 07:27 PDT | Database | Reply | BTEQ script help | There are no built in loops in BTEQ, so you have two possibilities:
- Do the loop in the unix shell, but then you have to logon several times.
- repeat the same stuff 5 times in BTEQ.
.logon... |
800 | 09 Sep 2010 @ 07:12 PDT | Tools | Reply | How to change a date column to show only month and year | Hi Maria,
you can use BTEQ's FORMAT, you just have to add a cast to CHAR:
select income_month (format 'yyyy-mm') (char(7))
Dieter
|
799 | 07 Sep 2010 @ 02:56 PDT | Database | Reply | How to use rank in update stmt | Use an
UPDATE ... FROM (your select to calculate the ranks)
Dieter |
798 | 07 Sep 2010 @ 02:53 PDT | Database | Reply | How to group a paricular column in a row of data, so that it could be used as in coalese | I really don't understand your question, but you can use CASE to return NULL for unwanted values, like:
coalesce(min(case class when 'first' then rate end),
min(case class when 'second' then ra... |
797 | 07 Sep 2010 @ 02:43 PDT | Extensibility | Reply | Querying XML Data stored in the database | XML Services doesn't support XQuery, but XPath functions can be used against XML CLOBs.
This is an example accessing DBQL data stored as XML in dbc.dbqlxmltbl (TD13):
select
queryid as Query... |
796 | 04 Sep 2010 @ 02:58 PDT | Database | Reply | Soft RI | Hi Adeel,
what do you mean by "more effort and more CPU time for processing the same data-set"?
Soft RI is a dummy, which is not checked by the DBMS.
Karam,
you answered your own question:
... |
795 | 04 Sep 2010 @ 02:46 PDT | Database | Reply | use of coalesce in Tera data | A TOP query without ORDER BY returns a random row (actually not random, but not the "last"/"first"/"highest")
Are you at the same site as this guy?
http://forums.teradata.com/forum/general/tera... |
794 | 04 Sep 2010 @ 02:38 PDT | General | Reply | Teradata equivalent Query of SQL Server | Strange query:
- if cp2_eff_dt/EFF_DT is actually a datetime in SQL Server, then why it's coalesced with an integer zero?
- it's all rows from CAP_SAC_CP211 or none, but it's kind of random, b... |
793 | 28 Jul 2010 @ 01:08 PDT | Tools | Reply | ERRLIMIT ignored in MLOAD script | The throughput for loading 6377 rows of approx. 200 bytes will not change if you use 1 or 20 sessions.
But if you load those 6377 rows on a large system without specifying the number of session... |
792 | 28 Jul 2010 @ 01:00 PDT | Database | Reply | Spool treatment for DISTINCT versus GROUP BY | As i can't attach a PDF i try to copy some of it and hope i can make it readable:
Explain Distinct:
3) We do an all-AMPs RETRIEVE step from ... by way of an
all-rows scan with no residual co... |
791 | 27 Jul 2010 @ 06:06 PDT | Database | Reply | SQL History | Hi Flavien,
- I'm currently logging for every user, but does it also logs every database or just one ?
the querylog is not based on accessed databases (this might be done with AccessLog), but o... |
790 | 27 Jul 2010 @ 04:54 PDT | General | Reply | Query to List the Alphabets in English | I would simpy use a table with all the neccessary characters in it.
It's like a calendar table, you fill it once and that's it.
Or you might write a Table UDF.
Btw, you post about Prime Numb... |
789 | 27 Jul 2010 @ 04:34 PDT | Database | Reply | Help With Joins | The data provided looked like preknown values/number of values, for this it's the right query.
If the values are unknown, but maximum number of rows per value is low/known and you just need a kind... |
788 | 27 Jul 2010 @ 03:54 PDT | Database | Reply | Specify datablock size, Percent freespace | Here it is, just copied straight from the manuals :-)
CREATE TABLE Employee,
DATABLOCKSIZE = 16384 BYTES,
CHECKSUM = LOW,
FREESPACE = 10 PERCENT,
(EmpNo SMALLINT FORMAT ’9(5)’
CHECK (Em... |
787 | 27 Jul 2010 @ 03:49 PDT | Database | Reply | Help With Joins | As you already wrote you need to join the same table twice:
select
from emp_table as e
left join address_table as home
on e.address_code = home.address_code
and address_type = 'home'
left ... |
786 | 27 Jul 2010 @ 03:45 PDT | Database | Reply | SQL History | Hi Flavien,
there are two kinds of logs in Teradata:
- AccessLog, mainly a security log, guaranteed to be written, but the souce code logged is limited to 8KB.
But you probably want
- QueryLo... |
785 | 27 Jul 2010 @ 03:36 PDT | Tools | Reply | ERRLIMIT ignored in MLOAD script | The number of errors might be higher than the specified errorlimit, because that limit is checked *after* a block of rows has been sent to the receiving AMP.
You didn't specify the number of sessi... |
784 | 21 Jul 2010 @ 06:12 PDT | Database | Reply | Pool size? | I never heard of a "pool size"?
Could you please elaborate what this is supposed to be?
The closest word would be "spool size" (regarding the maximum size of a spool during a query), but the "m... |
783 | 21 Jul 2010 @ 06:06 PDT | Tools | Reply | How to load large volumes into existing tables in real-time | This is not the right place for that kind of question :-)
You should contact your Teradata salesperson, they will be able to provide you with some info about number of nodes neccessary for that ... |
782 | 20 Jul 2010 @ 09:58 PDT | Database | Reply | Volatile table V/S Perminent table | If you use a qualified tablename, the parser adds that databasename to the list of default databases for that query.
Now you got two default databases, your "default" default DB and DATABASEME a... |
781 | 20 Jul 2010 @ 09:55 PDT | Tools | Reply | FLOAD V/S MLAOD | Preparation/Cleanup in FastLoad is just a part of phase #1/#2, but no separate phase.
It's simply a naming convention, you could talk about 2/3/4/5/6 phases whatever :-)
In fact MLoad's aqcuisi... |
780 | 20 Jul 2010 @ 05:52 PDT | General | Reply | Import Bteq Error | Strahge, there can't be a deadlock on a volatile table, because there are no locks on it.
Could you show your actual BTEQ script and/or it's output?
And i noted another problem, you didn't sp... |
779 | 20 Jul 2010 @ 03:46 PDT | Database | Reply | Global temporary tables | When you create a GTT then you actually create a kind of *template*, which is persistent and visible within the Data Dictionary.
Thus a GTT is created only once.
By submitting an INSERT you mat... |