2853 | 02 Jul 2014 @ 02:39 PDT | Database | Reply | execute immediate with sting in sql statement in teradata | Hi Frank,
your code is correct, a single quote within a string must be replaced by two single quotes. So this should run as-is.
Can you show your exact query?
Or the full SP source?
|
2852 | 02 Jul 2014 @ 02:35 PDT | Database | Reply | I Have totals by date, - want to get total "to date" for each date | No need for a join, this is a basic task for a "Windowed Aggregate Function", a cumulative sum:
select
_date, total,
sum(total)
over (order by _date
rows u... |
2851 | 30 Jun 2014 @ 10:46 PDT | Tools | Reply | Handling timestamp column during fast export | Did you check what's the bottleneck, BTEQ itself?
Why do you prefer BTEQ over FExp?
To export delimited data the best choice is a TPT Export in delimited format, no need to manually concat al... |
2850 | 28 Jun 2014 @ 08:18 PDT | Database | Reply | Query to Delete all the records in a table in Teradata | Nope, there's no difference when you add ALL, this is just an optional keyword.
You get a FastPath Delete when there's no Trigger/Foreign Key and it's known to the optimizer that the d... |
2849 | 28 Jun 2014 @ 01:55 PDT | Database | Reply | Problem in passing run time value for the date filed in Teradata view | There's no way to create a view like that (probably in any existing database).
But you can put it in a macro:
REPLACE MACRO mymacro (Month_End_Date DATE) AS (
SEL c.week_of_year
... |
2848 | 27 Jun 2014 @ 01:37 PDT | Database | Reply | Converting hh:mi:ss format to seconds | Hi Raja,
this will fail after 02:46:39 = 9999 seconds.
Better use
EXTRACT(HOUR FROM t) * 3600
+ EXTRACT(MINUTE FROM t) * 60
+ EXTRACT(SECOND FROM t)
It's easy to put this ... |
2847 | 26 Jun 2014 @ 11:20 PDT | Tools | Reply | Fastload I/O error 42 on flat file | Hi Boris,
to load CSV you need to
use SET RECORD DELIMITED instead of the default FORMATTED
specify the delimiter if it's not '|'
DEFINE all input as VARCHAR
&nb... |
2846 | 26 Jun 2014 @ 12:13 PDT | Database | Reply | Best way to generate the Sequential numbers : CSUM or IDENTITY columns? | There's no need to "PARTITION BY 0", simply remove it.
And you get a more efficient plan when you rewrite the cross join to a Scalar Subquery and the Left Join/IS NULL with a NOT EXI... |
2845 | 26 Jun 2014 @ 07:03 PDT | Database | Reply | optimize the query | Without DDL and Explain it's hard to tell.
NOT IN in an ORed condition might be bad, you probably don't need the join and can rewrite it with a simple NOT EXISTS:
OR NOT EXISTS (select * ... |
2844 | 26 Jun 2014 @ 06:52 PDT | General | Reply | Teradata SQL query run | Check syslib if they exist, maybe you're not using them correctly.
Both need parameters, e.g.
REPLACE FUNCTION SYSLIB.MonitorSQLSteps
(HostIdIn SMALLINT,
SessionNoIn INTEGER,
R... |
2843 | 26 Jun 2014 @ 06:50 PDT | General | Reply | I have alpanumeric,character and interger values in my column,by using case i want to char values as 'C',int values as 'I'. | Hi Purushotham,
without UDF or RegEx there's no easy way to determine that.
You could create a monster CASE to check each character for it's character class:
CASE WHEN SUBSTRING(c... |
2842 | 26 Jun 2014 @ 06:45 PDT | General | Reply | A constant value in a query is not valid for column | Hi Amit,
all your decimal values are not valid.
The first number in a DECIMAL defines the number of significant digits and the 2nd the fractional digits, so for a DECIMAL(15,15) the maximum value... |
2841 | 25 Jun 2014 @ 10:21 PDT | Database | Reply | Migrating Access Tables to Teradata | Is the Teradata Client installed on your system?
Then check the Start-menu for Teradata Client and see if there's a OleLoad or a Teradata Parallel Transporter Wizard.
Both can be used t... |
2840 | 24 Jun 2014 @ 06:40 PDT | Database | Reply | Identifying CPU wait time and IO wait time of a Query | As ResUsage is on system level you can't use it to get session level data.
You might check the query in Viewpoint and use the Rewind feature to go back in time.
Otherwise compare DBQL step da... |
2839 | 24 Jun 2014 @ 06:36 PDT | General | Reply | I have defined PPI on a table.But i am not using PPI in a Where clause,how would be the performance | It's not always better, only if the partitioning column is not part of the PI.
And the performance decrease mainly depends on the number of populated partitions, if it's just a few perform... |
2838 | 24 Jun 2014 @ 06:32 PDT | General | Reply | Teradata SQL query run | If you got luck (i.e. access rights) you might also access PMon data using some table-UDFs, e.g.
MonitorMySessions
MonitorSQLSteps
MonitorSQLCurrentStep
Check the "Application Prog... |
2837 | 24 Jun 2014 @ 05:03 PDT | Database | Reply | Monitor Partition | The "Monitor" partition is used for Performance Monitor-API requests like "MONITOR SESSION".
|
2836 | 23 Jun 2014 @ 12:16 PDT | Tools | Reply | Handling timestamp column during fast export | 22M records is not that much, but it mainly depends on the overall size, 22M * 100 bytes or 22M * 10KB...
You should try to find the bottleneck:
BTEQ is single-threaded, so check if one CPU is ru... |
2835 | 23 Jun 2014 @ 12:04 PDT | General | Reply | without specifying CASE SPECIFIC in a table, How can we retrieve only lower case letters in teradataC | Hi Purushotham,
You can simply add CASESPECIFIC within your query:
WHERE col (CASESPECIFIC) = 'suresh'
If you always need to get a case sensitive comparison you should be... |
2834 | 22 Jun 2014 @ 11:22 PDT | Tools | Reply | Handling timestamp column during fast export | There's no automatic typecast for TIME and TIMESTAMP, you must do it explicitly:
...
SUBSRPTN_STS_RSN_DESC ||'|'||
CAST(entry_dt_tm AS VARCHAR(20)) (title '')
|
2833 | 20 Jun 2014 @ 07:27 PDT | General | Reply | how to eliminate duplicate records in a file while loading into the target table without using fastload | Hi Purushotham,
you can't do that with MultiLoad if the target table is MULTISET.
You got two options:
1. use Unix to remove duplicates before loading as Raja suggested
2. FastLoad to a sta... |
2832 | 20 Jun 2014 @ 06:41 PDT | Database | Reply | SELECT AGGREGATE ERROR | If a column Patient_Status exists the parser will use this instead of the alias "Patient_Status".
So use a different alias or GROUP BY 1,2,3,4,5,6,7,8,9,10 instead.
|
2831 | 20 Jun 2014 @ 12:48 PDT | Analytics | Reply | SELECT Failed. 3706: Syntax error: expected something between '(' and the 'select' keyword. | Are you shure it's this SQL?
There's no fill_type_cd within it and it should run as-is.
|
2830 | 20 Jun 2014 @ 12:35 PDT | Database | Reply | Query to Delete all the records in a table in Teradata | Big tables are usually partitioned by date, e.g
PARTITION BY RANGE_N (trans_date BETWEEN DATE '2005-01-01' AND DATE '2020-12-31'
EACH INTERVAL '1' DAY
When you
DELE... |
2829 | 20 Jun 2014 @ 12:28 PDT | General | Reply | HOW TO RUN SAME DML STATEMENT IN 'N' NO OF TIMES IN BTEQ | There are two way in BTEQ, the one Raja mentioned:
your_select;
=n
.repeat n
your_select;
|