Hello Expert,
Could you please guide me about
How to avoid hard code logic value all over pl/sql application?
Is there something like this? possible?
For Example :
CREATE OR REPLACE PACKAGE test
AS
---place all hard code here as Hardcode Library.
v_code_1 VARCHAR2(32767) := ('114','124','134','144','154');
v_code_2 VARCHAR2(32767) := ('204','450','513','901','918');
---OR put into type table , something like this way if it works
v_code_1 varchar2_tt := varchar2_tt := ('114','124','134','144','154');
v_code_2 varchar2_tt := varchar2_tt := ('204','450','513','901','918');
procedure proc1;
function func1;
END test;
CREATE OR REPLACE PACKAGE BODY TEST
AS
procedure proc1
IS
BEGIN
IF l_code IN (V_CODE_1) THEN ----So that I dont have to repeat hard code logic here
PROCESS......
ELSIF l_code IN (V_CODE_2) THEN ----So that I dont have to repeat hard code logic here
PROCESS....
END IF;
more process........
END;
procedure FUNC1
RETURN boolean
IS
v_check BOOLEAN
BEGIN
IF l_code IN (V_CODE_1) THEN ----So that I dont have to repeat hard code logic here
PROCESS......
ELSIF l_code IN (V_CODE_2) THEN ----So that I dont have to repeat hard code logic here
PROCESS....
END IF;
more process........
RETURN check;
END;
END TEST;
Appreciate your insight.