liquibase.harness.data.changelogs.db2-z.loadUpdateData.sql Maven / Gradle / Ivy
CREATE PROCEDURE insertOrUpdateDb2Z()
BEGIN
DECLARE v_reccount INTEGER
SET v_reccount = (SELECT COUNT(*) FROM "LTHUSER".authors WHERE id = '1')
IF v_reccount = 0 THEN
INSERT INTO "LTHUSER".authors (id, first_name, last_name, email, birthdate, added) VALUES ('1', 'Adam', 'Gods', '[email protected]', '1000-02-27', '2000-02-04T02:32:00')
ELSEIF v_reccount = 1 THEN
UPDATE "LTHUSER".authors SET added = '2000-02-04T02:32:00', birthdate = '1000-02-27', email = '[email protected]', first_name = 'Adam', last_name = 'Gods' WHERE id = '1'
END IF
END
CALL insertOrUpdateDb2Z()
DROP PROCEDURE insertOrUpdateDb2Z
CREATE PROCEDURE insertOrUpdateDb2Z()
BEGIN
DECLARE v_reccount INTEGER
SET v_reccount = (SELECT COUNT(*) FROM "LTHUSER".authors WHERE id = '7')
IF v_reccount = 0 THEN
INSERT INTO "LTHUSER".authors (id, first_name, last_name, email, birthdate, added) VALUES ('7', 'Noah', 'Lamekhs', '[email protected]', '2000-02-27', '1994-12-10T01:00:00')
ELSEIF v_reccount = 1 THEN
UPDATE "LTHUSER".authors SET added = '1994-12-10T01:00:00', birthdate = '2000-02-27', email = '[email protected]', first_name = 'Noah', last_name = 'Lamekhs' WHERE id = '7'
END IF
END
CALL insertOrUpdateDb2Z()
DROP PROCEDURE insertOrUpdateDb2Z
CREATE PROCEDURE insertOrUpdateDb2Z()
BEGIN
DECLARE v_reccount INTEGER
SET v_reccount = (SELECT COUNT(*) FROM "LTHUSER".authors WHERE id = '8')
IF v_reccount = 0 THEN
INSERT INTO "LTHUSER".authors (id, first_name, last_name, email, birthdate, added) VALUES ('8', 'Muhammad', 'Ibn Abdullah', '[email protected]', '3000-02-27', '2000-12-10T01:00:00')
ELSEIF v_reccount = 1 THEN
UPDATE "LTHUSER".authors SET added = '2000-12-10T01:00:00', birthdate = '3000-02-27', email = '[email protected]', first_name = 'Muhammad', last_name = 'Ibn Abdullah' WHERE id = '8'
END IF
END
CALL insertOrUpdateDb2Z()
DROP PROCEDURE insertOrUpdateDb2Z
© 2015 - 2024 Weber Informatics LLC | Privacy Policy