Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Fri, 08 Jul 2005 @ 08:45:14 GMT


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


Subj:   Re: Question regarding Selection limits
 
From:   Shritypriya.Verma

Probably you can write a stored procedure or a shell/PERL script to do the job

     replace procedure p1 ()
     BEGIN
        DECLARE FirstCount Integer;
        DECLARE SamValue Integer;
        Insert into tbl1
       Select col1,col2, col3
          From tbl2
        Where col3 = 1
       ;
     Select count(*) into :FirstCount
       From tbl1
     ;
     SET SamValue = 50000 - FirstCount;
     CALL DBC.sysexecsql ('Insert into tbl1
     Select col1, col2, col3
       From tbl2
     Where not col1 in
       (select col1 from tbl1)
     Sample' || :SamValue);
     END;

Then call this procedure.

Hope I got your problem correctly



     
  <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