0 - 16 of 16 tags for loop

I am looking to build and Effective Date and Expiration Date utilzing a customers next purchase date in the table without a do loop if possible as I do not have access to buid stored procedures.
Below is an example of current data:
ID          InvoiceDate
ABC123  4/16/2015
ABC123  5/20/2015
ABC123  6/30/2015
 

SELECT 
  vw_TPDDP.System_NME
  ,vw_TDAD.Date_YYYY_FMT
  ,vw_TDAD.Date_MM_FMT
  ,vw_TPDDP.Company_CDE
  ,SUM(vw_TPF.AMT) Amt
FROM 
  vw_TDAD 
   INNER JOIN vw_TPF 
   ON (vw_TPF.Date_DIM_ID=vw_TDAD.Date_DIM_ID)
   INNER JOIN vw_TPDDP 
   ON (vw_TPF.Profile_DIM_ID=vw_TPDDP.Profile_DIM_ID)
WHERE 
  (  vw_TDAD.Date_YYYY_FMT  =  '2015'

Hello
Using version 15, I am stuck with 3707 error:
[5526] SPL1027:E(L417), Missing/Invalid SQL statement'E(3707):Syntax error, expected something like an 'END' keyword between ';' and the 'with' keyword.'.
Line 417 is the termination semicolon for a recursive query trying to concatenate a field:

Hi
   Is there a way by which we can declare variables in a loop dynamically. I would like to create a vaiables like Var1,Var2,Var3....as and when a new loop begins. If the loop executed 4 times, four such variables has to be created. Kindly help me on this. Thanks.
 
Regards
Arun

Hi all,
I want to acheive something which I scaled down to below sql,
insert into t1
sel 'annual',sum(a) from t2 where EOM_DT between '2013-10-01' and '2014-09-30';
insert into t1

Hi,
I'm new to TeraData. Following is the script i am using to create to While loop in Stored Procedure.
But TeraData Studio is giving me Syntax Error:
can we use loop in Stored Procedure or is there any other way to do that.
Kindly suggest.
CREATE PROCEDURE proc (
        IN i INTEGER,

Hi,
Due to size of data (not to blow spool space) I need to chop that big dataset with cursor looping through X millions of rows.

Many experienced SQL and procedure developers use SQL functions to perform common tasks and simplify their code narratives.

Does anyone know how to write a loop statement within a Teradata stored procedure? Here's what I'm trying to accomplish:

SELECT......
FROM......
WHERE CUST_NAME = 'AMY'
SELECT......
FROM......
WHERE CUST_NAME = 'JAMES'

...ETC.

Ordered analytical functions enable parallel processing by freeing processes from flat logic. They also produce simpler Set SQL statements, which as a general rule can be expected to perform better than more complex Set SQL statements.

Set SQL is a way of operating on data that is radically different from historical concepts of computer programming that can be diagrammed with flow charts.  Grab a cup of coffee and review some history that will explain why the industry is mired in cursor logic and loops that cannot exploit the power of today's software and hardware.

When Flat SQL looping logic involves complex processing of data elements from multiple tables, the loops can almost always be transformed into Set SQL with derived tables. By eliminating looping logic, the performance benefits of parallel processing can be exploited.

The most difficult task when converting Flat SQL (cursor-based procedural code) to Set SQL involves translating complex logic and accounting for multiple data sources.  The Derived Table feature of Set SQL simplifies this process.

Perhaps the easiest way to transition from a flat logic mindset to a set logic mindset is to convert some Flat SQL to Set SQL, then stare at both of them until the logical equivalence of the two approaches becomes clear.

Maximizing the full potential of Teradata's Massive Parallel Processing requires Set Processing.

Hi, I'm new to Teradata but am in the process of converting all of my SQL to run on my new Teradata App db....

I have a SQL snippet loop query that runs on SQL Server but it will not run as is on Teradata. I think I need to do something with cursor but am unsure. Can someone tell me how to convert this statement to run on Teradata? Thanks in advance.

CD1:

UPDATE NFAA_TABLES.NFAA_REGIONCD
SET LoopSpan = 'A'
from NFAA_TABLES.NFAA_REGIONCD nf1
WHERE LoopSpan is null
and exists
(
select *
from NFAA_TABLES.NFAA_REGIONCD nf2
WHERE nf2.LoopSpan = 'A'