Notes
Notes - notes.io |
CREATE OR REPLACE PROCEDURE proc_staff_email_cursor(in_festival_id festivals.festival_id%TYPE) IS
CURSOR cur_festivals IS
SELECT f.festival_id,s.firstname,s.surname,s.role,s.salary,s.email,s.contact,s.address.city city,s.address.street street,s.address.country country
FROM festivals f, TABLE(f.staff)s
WHERE f.festival_id=in_festival_id;
vc_staff1_firstname VARCHAR2(30);
vc_staff1_surname VARCHAR2(30);
vc_staff1_role VARCHAR2(30);
vn_staff1_salary NUMBER(8,2);
vc_staff1_email VARCHAR2(30);
vc_staff1_contact VARCHAR2(15);
vc_staff1_city VARCHAR2(30);
vc_staff1_street VARCHAR2(30);
vc_staff1_country VARCHAR2(30);
vc_staff2_firstname VARCHAR2(30);
vc_staff2_surname VARCHAR2(30);
vc_staff2_role VARCHAR2(30);
vn_staff2_salary NUMBER(8,2);
vc_staff2_email VARCHAR2(30);
vc_staff2_contact VARCHAR2(15);
vc_staff2_city VARCHAR2(30);
vc_staff2_street VARCHAR2(30);
vc_staff2_country VARCHAR2(30);
BEGIN
FOR rec_cur_festivals IN cur_festivals LOOP
if((cur_festivals%ROWCOUNT)=1) THEN
vc_staff1_firstname:=rec_cur_festivals.firstname;
vc_staff1_surname :=rec_cur_festivals.surname;
vc_staff1_role:=rec_cur_festivals.role;
vn_staff1_salary:=rec_cur_festivals.salary;
vc_staff1_email:=rec_cur_festivals.email;
vc_staff1_contact:=rec_cur_festivals.contact;
vc_staff1_city:=rec_cur_festivals.city;
vc_staff1_street:=rec_cur_festivals.street;
vc_staff1_country:=rec_cur_festivals.country;
ELSIF((cur_festivals%ROWCOUNT)=2) THEN
vc_staff2_firstname:=rec_cur_festivals.firstname;
vc_staff2_surname :=rec_cur_festivals.surname;
vc_staff2_role:=rec_cur_festivals.role;
vn_staff2_salary:=rec_cur_festivals.salary;
vc_staff2_email:=rec_cur_festivals.email;
vc_staff2_contact:=rec_cur_festivals.contact;
vc_staff2_city:=rec_cur_festivals.city;
vc_staff2_street:=rec_cur_festivals.street;
vc_staff2_country:=rec_cur_festivals.country;
END IF;
END LOOP;
vn_staff1_salary:=vn_staff1_salary+(vn_staff1_salary*0.15);
vn_staff2_salary:=vn_staff2_salary+(vn_staff2_salary*0.15);
UPDATE festivals f
SET f.staff=staff_varray_type(
staff_type(vc_staff1_firstname,vc_staff1_surname,vc_staff1_role,vn_staff1_salary,vc_staff1_email,vc_staff1_contact,address_type(vc_staff1_city,vc_staff1_street,vc_staff1_country)),
staff_type(vc_staff2_firstname,vc_staff2_surname,vc_staff2_role,vn_staff2_salary,vc_staff2_email,vc_staff2_contact,address_type(vc_staff2_city,vc_staff2_street,vc_staff2_country)))
WHERE f.festival_id=in_festival_id;
END proc_staff_email_cursor;
/
SHOW ERRORS;
EXEC proc_staff_email_cursor(300005);
|
Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 12 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team