Hi,
Yes, you can do that.
Follow these steps.
1).Write a code in the script object as mentioned below.
$G_Total_Record_Cnt=total_rows(datastorename.ownername.tablename);
print($G_Total_Record_Cnt);
$L_Records_Per_File=10000;
$G_Num_Of_Files=ceil(($G_Total_Record_Cnt/$L_Records_Per_File));
print($G_Num_Of_Files);
$G_File_Num =1;
$G_StartRecord=1;
$G_EndRecord=$L_Records_Per_File;
$G_Split_FileName =‘C:\Documents and Settings\0309\Desktop\’||‘SPLIT_FILE’||’’||$G_StartRecord||’’||$G_EndRecord||’’||to_char(sysdate( ),‘MMDDYYYY’)||’’||$G_File_Num||’.csv’;
2). After the script object, drag while loop object
In that loop apply condition like ($G_File_Num <= $G_Num_Of_Files)
Now drag DF into while loop .
In the first query transform,create a new column and apply gen_rownum() function.
In the next query transform, apply condition like
((Qry_Seq_Num.Gen_RowNum >= $G_StartRecord) AND
(Qry_Seq_Num.Gen_RowNum <= $G_EndRecord))
Finally, map to target file definition.
3). Add one more script object after DF.Write a code in the script as below specified.
print(‘SPLIT_FILE’||’’||$G_StartRecord||’’||$G_EndRecord||’’||to_char(sysdate( ),‘MMDDYYYY’)||’’||$G_File_Num||’.csv File has been created’);
$G_File_Num=$G_File_Num+1;
$G_StartRecord=$G_EndRecord+1;
$G_EndRecord=$G_EndRecord+$L_Records_Per_File;
$G_Split_FileName =‘C:\Documents and Settings\0309\Desktop\’||‘SPLIT_FILE’||’’||$G_StartRecord||’’||$G_EndRecord||’’||to_char(sysdate( ),‘MMDDYYYY’)||’’||$G_File_Num||’.csv’;
Regards,
Bob
Ram->
(BOB member since 2009-03-24)