1 2 3 4 5 6 7 8 9 10 11 12 13
| insert into anas_gre (
select ho.poste poste ,ho.entite entite,po.signe signe ,ho.date_operation date_operation,ho.date_valeur date_valeur ,ho.groupe_2 marche,af.description code_isin,ho.quantite quantite ,DECODE (ho.poste,
'AOBL', ho.montant_reglement,
'VOBL', ho.montant_reglement,
'SBB_OBL', ho.montant_reglement,
'BSB_OBL', ho.montant_reglement,
'SBB_OBL', ho.montant_reglement,
'FSBB_OBL', round(ho.montant_reglement
- ((ho.negocie_3 / 1.10) * 0.10),2),
'FBSB_OBL',round( ho.montant_reglement
- ((ho.negocie_3 / 1.10) * 0.10),2)
) montant_net,cf.code code_affilie,'O','N',ho.num_operation,'N' ,'N','N',ho.contrepartie from op.histo_operation ho,op.affilie_code af ,op.operation_poste po,op.code_affilie cf
where poste in ('AOBL','VOBL','SBB_OBL','BSB_OBL','FSBB_OBL','FBSB_OBL') and groupe_1 is not null and groupe_1 not in('CDG') and statut in ('V','P','U') and ho.poste=po.code and af.attribut='XX' and af.code_ref =ho.titre and cf.client=ho.groupe_1 and date_valeur=:date_operation and not exists (select 1 from op.spec_gregre gr where gr.num_operation=ho.num_operation )) |
Partager