Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 13 Feb 2008 @ 10:36:06 GMT


     
  <Prev Next>   <<First <Prev Next> Last>>  


Subj:   Re: PROBLEM WITH INTO...
 
From:   Stieger, Etienne E

Hi Sreenivasa,

You wrote:

  NOW I'M TRYING TO WRITE THE SAME QUERY IN TERADATA AS SELECT CAST(CURRENT_DATE AS FORMAT 'YYYY-MM-DD') INTO V_DATE1; BUT IT GIVING ERROR AS INTO CLAUSE IS NOT ALLOWED..  


As far a I am aware, "INTO" definitely DOES work.

Perhaps you need to make sure that you have a single-row query?

Here is a code snippet from a working stored procedure that I am using:

     select top 1 DBTB into :mySQL
     from
     (
         select *
         from
         (
             select 1 rnk, 'drop table'
                      ||trim(DatabaseName)
                      ||'.'
                      ||trim(TableName) DBTB
             from   dbc.tables
             where  DatabaseName = :WORKDB
             and    TableName    = :TB||'ERTBL'
             union all
             select 2 rnk, 'Table '
                      ||:WORKDB
                      ||'.'
                      ||:TB
                      ||'ERTBL not found'DBTB
             from   sys_calendar.CALENDAR
             where  calendar_date = date
         ) V_1
     QUALIFY (ROW_NUMBER() OVER(ORDER BY rnk ASC) > 0)
     ) V_2;

Regards

Etienne Stieger
Analytics and Information Management (AIM/EIW)
Standard Bank of South Africa Ltd



     
  <Prev Next>   <<First <Prev Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023