insert into metadata_statistics (order_sequence, metadata_defn, total_entries, rundate, metadata_id)
select 
rownumber() over (order by length(dbl_blob) desc), 
'SizePerScript', 
length(dbl_blob) , current timestamp, dbl_doc_id
from dhi, dbl
where dbl_doc_id = dhi_doc_id
and   dbl_cmp_id = dhi_cmp_id
and   dbl_cmp_id = 40001
and substr(dhi_doc_path,1,9) = '/scripts/'
;
commit;
