DECLARE
v_reccount NUMBER := 0;
BEGIN
SELECT COUNT INTO v_reccount FROM INTUSER.contacts WHERE id = 1;
IF v_reccount = 0 THEN
INSERT INTO INTUSER.contacts (id, activeflag, firstname, lastname, age, lastcall) VALUES (1, 1, 'Chris', 'Klackson', 32, to_date('2013-07-04 12:33:27', 'YYYY-MM-DD HH24:MI:SS'));
ELSIF v_reccount = 1 THEN
UPDATE INTUSER.contacts SET activeflag = 1, age = 32, firstname = 'Chris', lastcall = to_date('2025-07-04 12:33:27', 'YYYY-MM-DD HH24:MI:SS'), lastname = 'Klackson' WHERE id = 1;
END IF;
END;
/;
DECLARE
v_reccount NUMBER := 0;
BEGIN
SELECT COUNT INTO v_reccount FROM INTUSER.contacts WHERE id = 2;
IF v_reccount = 0 THEN
INSERT INTO INTUSER.contacts (id, activeflag, firstname, lastname, age, lastcall) VALUES (2, 0, 'Samantha', 'Sallers', 47, to_date('2013-07-15 01:01:16', 'YYYY-MM-DD HH24:MI:SS'));
ELSIF v_reccount = 1 THEN
UPDATE INTUSER.contacts SET activeflag = 0, age = 47, firstname = 'Samantha', lastcall = to_date('2025-07-15 01:01:16', 'YYYY-MM-DD HH24:MI:SS'), lastname = 'Sallers' WHERE id = 2;
END IF;
END;
/;
DECLARE
v_reccount NUMBER := 0;
BEGIN
SELECT COUNT INTO v_reccount FROM INTUSER.contacts WHERE id = 3;
IF v_reccount = 0 THEN
INSERT INTO INTUSER.contacts (id, activeflag, firstname, lastname, age, lastcall) VALUES (3, 1, 'Pete', 'Prosser', 50, to_date('2013-07-15 06:45:48', 'YYYY-MM-DD HH24:MI:SS'));
ELSIF v_reccount = 1 THEN
UPDATE INTUSER.contacts SET activeflag = 1, age = 50, firstname = 'Pete', lastcall = to_date('2025-07-15 06:45:48', 'YYYY-MM-DD HH24:MI:SS'), lastname = 'Prosser' WHERE id = 3;
END IF;
END;
/;
DECLARE
v_reccount NUMBER := 0;
BEGIN
SELECT COUNT INTO v_reccount FROM INTUSER.contacts WHERE id = 4;
IF v_reccount = 0 THEN
INSERT INTO INTUSER.contacts (id, activeflag, firstname, lastname, age, lastcall) VALUES (4, 0, 'Joeseph', 'Scala', 71, to_date('2012-07-28 03:14:32', 'YYYY-MM-DD HH24:MI:SS'));
ELSIF v_reccount = 1 THEN
UPDATE INTUSER.contacts SET activeflag = 0, age = 71, firstname = 'Joeseph', lastcall = to_date('2025-07-28 03:14:32', 'YYYY-MM-DD HH24:MI:SS'), lastname = 'Scala' WHERE id = 4;
END IF;
END;
/;
DECLARE
v_reccount NUMBER := 0;
BEGIN
SELECT COUNT INTO v_reccount FROM INTUSER.contacts WHERE id = 5;
IF v_reccount = 0 THEN
INSERT INTO INTUSER.contacts (id, activeflag, firstname, lastname, age, lastcall) VALUES (5, 0, 'Umbert', 'Klassenmass', 31, to_date('2012-09-17 22:11:08', 'YYYY-MM-DD HH24:MI:SS'));
ELSIF v_reccount = 1 THEN
UPDATE INTUSER.contacts SET activeflag = 0, age = 31, firstname = 'Umbert', lastcall = to_date('2025-09-17 22:11:08', 'YYYY-MM-DD HH24:MI:SS'), lastname = 'Klassenmass' WHERE id = 5;
END IF;
END;
/;
DECLARE
v_reccount NUMBER := 0;
BEGIN
SELECT COUNT INTO v_reccount FROM INTUSER.contacts WHERE id = 6;
IF v_reccount = 0 THEN
INSERT INTO INTUSER.contacts (id, activeflag, firstname, lastname, age, lastcall) VALUES (6, 1, 'Gary', 'Finer', 36, to_date('2013-09-17 18:25:09', 'YYYY-MM-DD HH24:MI:SS'));
ELSIF v_reccount = 1 THEN
UPDATE INTUSER.contacts SET activeflag = 1, age = 36, firstname = 'Gary', lastcall = to_date('2025-09-17 18:25:09', 'YYYY-MM-DD HH24:MI:SS'), lastname = 'Finer' WHERE id = 6;
END IF;
END;
/; |