yes it is the script file created in a conditional transform.
In that script ,
create variable
table_name =
SELECT distinct "Table_"||BB.PATTERN FROM
(SELECT
rank() over(partition by AA.pattern) RANK1,AA.PATTERN FROM
(select distinct pattern from source)AA
)BB
WHERE BB.RANK1 = COUNT1;
first query :
select distinct pattern from source will get you all the distinct pattern from source like 0000,0001 etc.
Now,I am giving rank to patterns i.e
0000 will get rank =1
0001 will get rank =2
so on..
Now as you job runs at the first value of Count1 would 1;
So,that 1 will get joined with rank =1 so first table name would be Table_0000 & at the same time in query transform you have to apply where clause with condition like
pattern = substr($table_name,7,4) which in turns bring all the records of pattern 0000 & enter the same into target table then in the final script you are renaming the table name as follows:
Count1 := Count1+1;
rename table template_table to table_name;
Thanks,
Swapnil