antes tarde do que nunca...
Eu estava quebrando a cabeça com PIVOT para passar parâmetro para o FOR ao invés de informações fixas, e só da com PIVOT XML.
Fuçando pela rede e fazendo um monte de testes consegui montar uma rotina.
Não é a coisa mais bonita do mundo mas funcionou.
Selecionar tudo
create table Tmp_Vendas_Pivot(
Cd_fabr number(3),
dt_emis date,
qt_item number(12));
Insert Into Tmp_Vendas_Pivot(Cd_Fabr,Dt_Emis,Qt_Item) Values('1',to_date('01/04/2017','dd/mm/yyyy'),20467);
Insert Into Tmp_Vendas_Pivot(Cd_Fabr,Dt_Emis,Qt_Item) Values('1',to_date('02/04/2017','dd/mm/yyyy'),0);
Insert Into Tmp_Vendas_Pivot(Cd_Fabr,Dt_Emis,Qt_Item) Values('1',to_date('03/04/2017','dd/mm/yyyy'),53159);
Insert Into Tmp_Vendas_Pivot(Cd_Fabr,Dt_Emis,Qt_Item) Values('1',to_date('04/04/2017','dd/mm/yyyy'),59008);
Insert Into Tmp_Vendas_Pivot(Cd_Fabr,Dt_Emis,Qt_Item) Values('1',to_date('05/04/2017','dd/mm/yyyy'),52045);
Insert Into Tmp_Vendas_Pivot(Cd_Fabr,Dt_Emis,Qt_Item) Values('1',to_date('06/04/2017','dd/mm/yyyy'),52714);
Insert Into Tmp_Vendas_Pivot(Cd_Fabr,Dt_Emis,Qt_Item) Values('1',to_date('07/04/2017','dd/mm/yyyy'),51635);
Insert Into Tmp_Vendas_Pivot(Cd_Fabr,Dt_Emis,Qt_Item) Values('1',to_date('08/04/2017','dd/mm/yyyy'),21566);
Insert Into Tmp_Vendas_Pivot(Cd_Fabr,Dt_Emis,Qt_Item) Values('1',to_date('09/04/2017','dd/mm/yyyy'),0);
Insert Into Tmp_Vendas_Pivot(Cd_Fabr,Dt_Emis,Qt_Item) Values('2',to_date('01/04/2017','dd/mm/yyyy'),0);
Insert Into Tmp_Vendas_Pivot(Cd_Fabr,Dt_Emis,Qt_Item) Values('2',to_date('02/04/2017','dd/mm/yyyy'),0);
Insert Into Tmp_Vendas_Pivot(Cd_Fabr,Dt_Emis,Qt_Item) Values('2',to_date('03/04/2017','dd/mm/yyyy'),0);
Insert Into Tmp_Vendas_Pivot(Cd_Fabr,Dt_Emis,Qt_Item) Values('2',to_date('04/04/2017','dd/mm/yyyy'),0);
Insert Into Tmp_Vendas_Pivot(Cd_Fabr,Dt_Emis,Qt_Item) Values('2',to_date('05/04/2017','dd/mm/yyyy'),0);
Insert Into Tmp_Vendas_Pivot(Cd_Fabr,Dt_Emis,Qt_Item) Values('2',to_date('06/04/2017','dd/mm/yyyy'),166);
Insert Into Tmp_Vendas_Pivot(Cd_Fabr,Dt_Emis,Qt_Item) Values('2',to_date('07/04/2017','dd/mm/yyyy'),0);
Insert Into Tmp_Vendas_Pivot(Cd_Fabr,Dt_Emis,Qt_Item) Values('2',to_date('08/04/2017','dd/mm/yyyy'),0);
Insert Into Tmp_Vendas_Pivot(Cd_Fabr,Dt_Emis,Qt_Item) Values('2',to_date('09/04/2017','dd/mm/yyyy'),0);
Insert Into Tmp_Vendas_Pivot(Cd_Fabr,Dt_Emis,Qt_Item) Values('3',to_date('01/04/2017','dd/mm/yyyy'),4405);
Insert Into Tmp_Vendas_Pivot(Cd_Fabr,Dt_Emis,Qt_Item) Values('3',to_date('02/04/2017','dd/mm/yyyy'),0);
Insert Into Tmp_Vendas_Pivot(Cd_Fabr,Dt_Emis,Qt_Item) Values('3',to_date('03/04/2017','dd/mm/yyyy'),16213);
Insert Into Tmp_Vendas_Pivot(Cd_Fabr,Dt_Emis,Qt_Item) Values('3',to_date('04/04/2017','dd/mm/yyyy'),18545);
Insert Into Tmp_Vendas_Pivot(Cd_Fabr,Dt_Emis,Qt_Item) Values('3',to_date('05/04/2017','dd/mm/yyyy'),16103);
Insert Into Tmp_Vendas_Pivot(Cd_Fabr,Dt_Emis,Qt_Item) Values('3',to_date('06/04/2017','dd/mm/yyyy'),13802);
Insert Into Tmp_Vendas_Pivot(Cd_Fabr,Dt_Emis,Qt_Item) Values('3',to_date('07/04/2017','dd/mm/yyyy'),11159);
Insert Into Tmp_Vendas_Pivot(Cd_Fabr,Dt_Emis,Qt_Item) Values('3',to_date('08/04/2017','dd/mm/yyyy'),3770);
Insert Into Tmp_Vendas_Pivot(Cd_Fabr,Dt_Emis,Qt_Item) Values('3',to_date('09/04/2017','dd/mm/yyyy'),0);
Insert Into Tmp_Vendas_Pivot(Cd_Fabr,Dt_Emis,Qt_Item) Values('5',to_date('01/04/2017','dd/mm/yyyy'),4420);
Insert Into Tmp_Vendas_Pivot(Cd_Fabr,Dt_Emis,Qt_Item) Values('5',to_date('02/04/2017','dd/mm/yyyy'),0);
Insert Into Tmp_Vendas_Pivot(Cd_Fabr,Dt_Emis,Qt_Item) Values('5',to_date('03/04/2017','dd/mm/yyyy'),13574);
Insert Into Tmp_Vendas_Pivot(Cd_Fabr,Dt_Emis,Qt_Item) Values('5',to_date('04/04/2017','dd/mm/yyyy'),6120);
Insert Into Tmp_Vendas_Pivot(Cd_Fabr,Dt_Emis,Qt_Item) Values('5',to_date('05/04/2017','dd/mm/yyyy'),1004);
Insert Into Tmp_Vendas_Pivot(Cd_Fabr,Dt_Emis,Qt_Item) Values('5',to_date('06/04/2017','dd/mm/yyyy'),11133);
Insert Into Tmp_Vendas_Pivot(Cd_Fabr,Dt_Emis,Qt_Item) Values('5',to_date('07/04/2017','dd/mm/yyyy'),9693);
Insert Into Tmp_Vendas_Pivot(Cd_Fabr,Dt_Emis,Qt_Item) Values('5',to_date('08/04/2017','dd/mm/yyyy'),5840);
Insert Into Tmp_Vendas_Pivot(Cd_Fabr,Dt_Emis,Qt_Item) Values('5',to_date('09/04/2017','dd/mm/yyyy'),0);
Insert Into Tmp_Vendas_Pivot(Cd_Fabr,Dt_Emis,Qt_Item) Values('6',to_date('01/04/2017','dd/mm/yyyy'),266);
Insert Into Tmp_Vendas_Pivot(Cd_Fabr,Dt_Emis,Qt_Item) Values('6',to_date('02/04/2017','dd/mm/yyyy'),0);
Insert Into Tmp_Vendas_Pivot(Cd_Fabr,Dt_Emis,Qt_Item) Values('6',to_date('03/04/2017','dd/mm/yyyy'),774);
Insert Into Tmp_Vendas_Pivot(Cd_Fabr,Dt_Emis,Qt_Item) Values('6',to_date('04/04/2017','dd/mm/yyyy'),854);
Insert Into Tmp_Vendas_Pivot(Cd_Fabr,Dt_Emis,Qt_Item) Values('6',to_date('05/04/2017','dd/mm/yyyy'),791);
Insert Into Tmp_Vendas_Pivot(Cd_Fabr,Dt_Emis,Qt_Item) Values('6',to_date('06/04/2017','dd/mm/yyyy'),1170);
Insert Into Tmp_Vendas_Pivot(Cd_Fabr,Dt_Emis,Qt_Item) Values('6',to_date('07/04/2017','dd/mm/yyyy'),597);
Insert Into Tmp_Vendas_Pivot(Cd_Fabr,Dt_Emis,Qt_Item) Values('6',to_date('08/04/2017','dd/mm/yyyy'),76);
Insert Into Tmp_Vendas_Pivot(Cd_Fabr,Dt_Emis,Qt_Item) Values('6',to_date('09/04/2017','dd/mm/yyyy'),0);
Espere que sirva pra alguém.