Skip to content

Commit 8aed869

Browse files
[skip ci]
[skip ci]
1 parent 7baf2d6 commit 8aed869

File tree

1 file changed

+76
-0
lines changed

1 file changed

+76
-0
lines changed

informix-identity-trigger-proc.sql

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
--databse common_oltp
2+
3+
DROP PROCEDURE informix.proc_email_update;
4+
CREATE PROCEDURE informix.proc_email_update(
5+
email_id decimal(10,0),
6+
user_id DECIMAL(10,0),
7+
old_email_type_id DECIMAL(5,0),
8+
new_email_type_id DECIMAL(5,0),
9+
old_address VARCHAR(100),
10+
new_address VARCHAR(100),
11+
old_primary_ind DECIMAL(1,0),
12+
new_primary_ind DECIMAL(1,0),
13+
old_status_id DECIMAL(3,0),
14+
new_status_id DECIMAL(3,0)
15+
)
16+
17+
if (old_email_type_id != new_email_type_id) then
18+
insert into audit_user (column_name, old_value, new_value, user_id)
19+
values ('EMAIL_TYPE', old_email_type_id, new_email_type_id, user_id);
20+
End If;
21+
22+
if (old_status_id != new_status_id) then
23+
insert into audit_user (column_name, old_value, new_value, user_id)
24+
values ('EMAIL_STATUS', old_status_id, new_status_id, user_id);
25+
End If;
26+
27+
if (old_address != new_address) then
28+
insert into audit_user (column_name, old_value, new_value, user_id)
29+
values ('EMAIL_ADDRESS', old_address, new_address, user_id);
30+
End If;
31+
32+
if (old_primary_ind != new_primary_ind) then
33+
insert into audit_user (column_name, old_value, new_value, user_id)
34+
values ('EMAIL_PRIMARY_IND', old_primary_ind, new_primary_ind, user_id);
35+
End If;
36+
if (USER != 'ifxsyncuser') then
37+
update email set modify_date = current where email.email_id = email_id;
38+
End if;
39+
end procedure;
40+
41+
42+
--database informixoltp
43+
DROP PROCEDURE informix.proc_coder_update;
44+
CREATE PROCEDURE informix.proc_coder_update(
45+
v_oldcoder_id decimal(10,0),
46+
v_oldquote varchar(255),v_newquote varchar (255),
47+
v_oldlanguage_id decimal(3,0), v_newlanguage_id decimal(3,0),
48+
v_oldcoder_type_id decimal(3,0), v_newcoder_type_id decimal(3,0),
49+
v_oldcomp_country_code varchar(3), v_newcomp_country_code varchar(3)
50+
)
51+
52+
if (v_oldquote != v_newquote) then
53+
insert into audit_coder (column_name, old_value, new_value, user_id)
54+
values ('QUOTE', v_oldquote , v_newquote, v_oldcoder_id);
55+
End if;
56+
57+
if (v_oldcoder_type_id != v_newcoder_type_id) then
58+
insert into audit_coder (column_name, old_value, new_value, user_id)
59+
values ('CODER_TYPE', v_oldcoder_type_id , v_newcoder_type_id, v_oldcoder_id);
60+
End if;
61+
62+
if (v_oldlanguage_id != v_newlanguage_id) then
63+
insert into audit_coder (column_name, old_value, new_value, user_id)
64+
values ('LANGUAGE', v_oldlanguage_id , v_newlanguage_id, v_oldcoder_id);
65+
End if;
66+
67+
if (v_oldcomp_country_code != v_newcomp_country_code) then
68+
insert into audit_coder (column_name, old_value, new_value, user_id)
69+
values ('COMP_COUNTRY', v_oldcomp_country_code , v_newcomp_country_code, v_oldcoder_id);
70+
End if;
71+
72+
if (USER != 'ifxsyncuser') then
73+
update coder set modify_date = current where coder_id = v_oldcoder_id;
74+
End if;
75+
76+
end procedure;

0 commit comments

Comments
 (0)