Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Fri, 28 Mar 2009 @ 02:01:55 GMT


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


Subj:   Re: Deleting on an identity column
 
From:   McCall, Glenn David

  I have the column's data type to be set as an INTEGER. It works fine for creation, but when I attempt to delete the column by the identity column, row does not get picked up.  


I'm not sure what you mean. Do you mean that if you did this, the row is not removed from the table?

     create table gmc_id_test (
          i1   integer generated always as identity,
          c1   varchar (20)
     )
     primary index (i1);

     insert into gmc_id_test (c1) values ('hello');
     insert into gmc_id_test (c1) values ('there');
     select *
     from gmc_id_test
     order by 1;

     Result:

        i1   c1
        1   hello
        2   there


     delete from gmc_id_test
     where i1 = 1;

     select *
     from gmc_id_test
     order by 1;

     Result:
        i1   c1
        2   there

Can you try the above? Obviously double check the values allocated to i1 and modify the delete accordingly.

If the above is not what you mean, can you provide more detail? Eg. Teradata version, table definition etc - in fact repeat what I did above and include it in an email. Preferable edited to the **smallest possible set** of queries that illustrates your problem.


Glenn Mc



     
  <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