Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Upit za Classic Report
- select n001 as zaposlenik_id
- ,c001 as ime
- ,c002 as prezime
- ,d001 as datum_rodjenja
- ,c003 as spol
- from apex_collections
- where collection_name = 'ZAPOSLENIK';
- -- BLOK 1
- if not apex_collection.collection_exists('ZAPOSLENIK') then
- apex_collection.create_or_truncate_collection('ZAPOSLENIK');
- for rec in (select zaposlenik_id
- ,ime
- ,prezime
- ,datum_rodjenja
- ,spol
- from zaposlenik)
- loop
- apex_collection.add_member(
- p_collection_name => 'ZAPOSLENIK'
- ,p_n001 => rec.zaposlenik_id
- ,p_c001 => rec.ime
- ,p_c002 => rec.prezime
- ,p_d001 => rec.datum_rodjenja
- ,p_c003 => rec.spol
- );
- end loop;
- end if;
- -- BLOK 2
- select seq_id
- ,c001 as ime
- ,c002 as prezime
- ,d001 as datum_rodjenja
- ,c003 as spol
- into :P13_SEQ_ID
- ,:P13_IME
- ,:P13_PREZIME
- ,:P13_DATUM_RODJENJA
- ,:P13_SPOL
- from apex_collections
- where collection_name = 'ZAPOSLENIK'
- and n001 = :P13_ZAPOSLENIK_ID;
- -- BLOK 3
- apex_collection.update_member (
- p_collection_name => 'ZAPOSLENIK'
- ,p_seq => :P13_SEQ_ID
- ,p_c001 => :P13_IME
- ,p_c002 => :P13_PREZIME
- ,p_d001 => :P13_DATUM_RODJENJA
- ,p_c003 => :P13_SPOL
- );
- -- BLOK 4
- for rec in (select n001 as zaposlenik_id
- ,c001 as ime
- ,c002 as prezime
- ,d001 as datum_rodjenja
- ,c003 as spol
- from apex_collections
- where collection_name = 'ZAPOSLENIK')
- loop
- update zaposlenik
- set ime = rec.ime
- ,prezime = rec.prezime
- ,datum_rodjenja = rec.datum_rodjenja
- ,spol = rec.spol
- where zaposlenik_id = rec.zaposlenik_id;
- end loop;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement