-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdelete_task.sql
61 lines (53 loc) · 1.23 KB
/
delete_task.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
-- FUNCTION: code_src.delete_task(numeric)
-- DROP FUNCTION code_src.delete_task(numeric);
CREATE OR REPLACE FUNCTION code_src.delete_task(
taskid numeric)
RETURNS text
LANGUAGE 'plpgsql'
COST 100
VOLATILE SECURITY DEFINER
AS $BODY$
DECLARE
o_status text;
o_message text;
o_json text;
BEGIN
/*
Summary:
Delete a task.
Testing:
SELECT delete_task(1000000036)
*/
o_status = 'OK';
o_message = '';
DELETE FROM ige_task
WHERE task_id = $1;
/* -- Beginning of updating Oracle
DELETE FROM imaint_anchor.ige_task
WHERE task_id = $1;
-- End of updating Oracle */
SELECT row_to_json(c) INTO o_json
FROM
(
SELECT o_status status,
o_message message
) c;
RETURN o_json;
EXCEPTION
WHEN OTHERS THEN
o_status = SQLSTATE;
o_message = SQLERRM;
SELECT row_to_json(c) INTO o_json
FROM
(
SELECT o_status status,
o_message message
) c;
RETURN o_json;
END;
$BODY$;
ALTER FUNCTION code_src.delete_task(numeric)
OWNER TO network;
GRANT EXECUTE ON FUNCTION code_src.delete_task(numeric) TO anchorto_run;
GRANT EXECUTE ON FUNCTION code_src.delete_task(numeric) TO network;
REVOKE ALL ON FUNCTION code_src.delete_task(numeric) FROM PUBLIC;