Archives of the TeradataForum
Message Posted: Fri, 08 Jul 2005 @ 08:45:14 GMT
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
|