2928 | 19 Jul 2014 @ 03:33 PDT | General | Reply | convert 13 digit epoch time to date? | This is the correct calculation, but it's based on UTC and your time zone might differ.
I use these SQL UDF to convert to/from Unix time:
/**********
Converting Unix/POSIX time to a Timest... |
2927 | 18 Jul 2014 @ 08:05 PDT | Database | Reply | Sorting the table in ascending order | There's no guarantee that rows are retuned in a specific order in any DBMS without an ORDER BY.
Access happens to store the data based on the PK, but in SQL Server this might change, too.
500... |
2926 | 18 Jul 2014 @ 05:53 PDT | Database | Reply | Facing issue in Sybase to Teradata migration stored procs | Did you read my answer at
http://forums.teradata.com/forum/database/sybase-similar-function-and-teradata-14-0-equivalent#comment-134462
|
2925 | 18 Jul 2014 @ 05:31 PDT | Database | Reply | USLARE in Teradata | There's no USLARE keyword in Teradata, should probably be DECLARE.
|
2924 | 18 Jul 2014 @ 03:08 PDT | Database | Reply | SQL statement wanted | Hi Helmut,
is there a row for every date?
What if a date is missing?
You need to nest OLAP functions:
SELECT
OUTLET_ID
,QUALITY_FLAG
,COUNT(*)
,MIN(DATE_ID)
,MAX(DATE_ID)
FRO... |
2923 | 17 Jul 2014 @ 02:09 PDT | Database | Reply | sel cast(10**9 as int) giving wrong result | The exponentiation operator ** results in a FLOAT, which might be the reason.
In TD14 you could use POWER(10,8) instead which returns a NUMBER (and a correct result ofter the CAST).
Before you co... |
2922 | 17 Jul 2014 @ 01:56 PDT | Database | Reply | regexp_replace woes | Hi Aniket,
the REGEXP_REPLACE in Aster has different arguments:
regexp_replace(source, pattern, replacement [, flags ])
This should work:
regexp_replace(text_with_htmltags, '<([^>])*&... |
2921 | 17 Jul 2014 @ 10:35 PDT | Third Party Software | Reply | Having an issue with my ODBC connection to Teradata within Access | Without formatting this is hardly readable (I know it's Access).
But a qualified table name looks like databasename.tablename, so it should be DL_QPT_CQE.QUALMAIN
|
2920 | 17 Jul 2014 @ 07:35 PDT | Database | Reply | Choosing FExp/TPump or regular Insert STMT | Hi Vinod,
in the Database Administration manual there a chapter on Loading and Exporting Data including performance considerations:
http://www.info.teradata.com/HTMLPubs/DB_TTU_14_10/Database_Man... |
2919 | 17 Jul 2014 @ 07:23 PDT | Database | Reply | Relation between Database and Users | Why all other DBMSes got similar concepts, users and databases/schemas/owners, too?
Do you want to create random passwords for maybe hundreds of users which never logon?
|
2918 | 17 Jul 2014 @ 07:12 PDT | Database | Reply | Group by on a Group by not working as expected!!! | Hi Peter,
what's the error you get, a 3504?
I just tried it and all SELECTs worked on my system :-)
So the optmizer might be more clever in a newer release and notices the dependency b... |
2917 | 17 Jul 2014 @ 06:44 PDT | Database | Reply | Need Query/Procedure to concatenate multiple(n) rows into one row for a particular record dynamically | Hi Sathya,
based on your example there's probably a known maximum line_num, so easiest to write is this, it's mainly cut&paste:
select eid, name,
max(case when line_num = 1 the... |
2916 | 17 Jul 2014 @ 01:39 PDT | Database | Reply | Relation between Database and Users | As a user is the same as a database every user can be granted access to D.
E.g. every user has access to the owner of the system tables, DBC, via PUBLIC rights.
The term database is ... |
2915 | 16 Jul 2014 @ 11:04 PDT | Database | Reply | How to Query between two tables involvng timestamps | What's the actual Primary Key of your tables?
You need to add a condition like this:
WHERE A.ENTITY_KEY = B.ENTITY_KEY
AND DOC_TMSTMP BETWEEN LOG_TMSTMP AND LOG_TMSTMP + INTERVAL '1&... |
2914 | 16 Jul 2014 @ 01:15 PDT | Database | Reply | Blank space check based on the position | Of course casting to a numeric value will fail if there are non-numeric characters in your string.
If you can't use REGEX_SIMILAR you need to check each character if it's between '0... |
2913 | 16 Jul 2014 @ 12:05 PDT | Tools | Reply | Fastload Problem: Invalid Fastload Statement | You can use a typecast in FastLoad, but it must be Teradata style, not CAST :-)
(:dtime (TIMESTAMP(0), format 'yyyy-mm-ddbhh:mi:ss'))
|
2912 | 16 Jul 2014 @ 10:30 PDT | Database | Reply | Update date format and create timestamp column | DATE/TIME/TIMESTAMP are always stored in an internal format, what you want is to change the display format, this can be done using adding a FORMAT to the column definition and then a CAST to a VARC... |
2911 | 16 Jul 2014 @ 10:24 PDT | Database | Reply | Relationships between the tables | You already have indexes :-)
If you define a PK in the Create Table Teradata will implement it as an Index, a Unique Primary Index (UPI).
You can keep the PK/UPI for your other tables (which are ... |
2910 | 16 Jul 2014 @ 02:38 PDT | General | Reply | Query Aggregation & group by issue | Hi Pankaj,
I don't know what you actually want, but this might be correct:
select SUM( CASE WHEN (TRIM(col1) NOT IN ('A','B','C') AND lkp.col2='X') THEN src.... |
2909 | 15 Jul 2014 @ 11:27 PDT | General | Reply | SELECT TOP 10 * FROM VIEW spool error | Hi Robert,
the view is not complex, but there's a WHERE-condition in it and that's enough to make the TOP slow :-(
Both TOP and SAMPLE are always applied as last step and any WHERE/JOIN/G... |
2908 | 15 Jul 2014 @ 11:23 PDT | Database | Reply | Embedded Dynamic SQL to Execute an Update Statement | Hi Howard,
Excel can directly access any database via ODBC using Microsoft Query:
http://office.microsoft.com/en-us/excel-help/use-microsoft-query-to-retrieve-external-data-HA010099664.aspx
http... |
2907 | 15 Jul 2014 @ 10:57 PDT | Private Forum |
2906 | 15 Jul 2014 @ 10:19 PDT | Database | Reply | Checking for Null Values to Make Comparisons | Seems like you want to return NULL if any of the columns is NULL. As any comparison to NULL will result in UNKNOWN and the default for ELSE is NULL you might simplify it like:
CASE WHEN FIELD_1 ... |
2905 | 15 Jul 2014 @ 10:12 PDT | Private Forum |
2904 | 15 Jul 2014 @ 09:28 PDT | Database | Reply | Embedded Dynamic SQL to Execute an Update Statement | Hi Howard,
within an Excel sheet there's no need to prepare/execute, this is for Embedded SQL/Stored Procedures only.
So running the update directly should work.
|