Hi All,
I have a trigger block which executes when there is an insert or update in a table say TableA.
Inside the trigger they are refering hard coded data (we can call as run codes ) .These run codes can vary in range example of 100-150 and there is some logic being executed in trigger based on these run codes sets. Now I am removing these hard coded reference of run code from trigger by addingthese value into a different table -Table B Run codes are comma seperated values.
Run code 1:100,101,102,110,121
Run code 2:122,139
Run code 3:140,145
I currently created 2 variables each for the run codes.
"select run code into var1 from table B where condition 1” .then in next variable Var2 used instr function to see if the run code being referred is present in var1.(In instr I wrapped the values in comma so that they are considered as a single value ) and flagged 1(if present)/0(not avilable ) and used this Var2 in place of hard coded reference in sql block
Kindly suggest if there is any other approach or any issues with the above