Setting the search flag
CREATE
OR REPLACE PROCEDURE <procedure_name>ISBEGIN
For i in
(select PARAMETER_SET_FIELD_ID, DISPLAY_FLAG from knta_parameter_set_fields a where parameter_set_context_id
IN
(Select parameter_set_context_id
from knta_parameter_set_contexts
where context_value
IN
(SELECT TO_CHAR(REQUEST_TYPE_ID) FROM KCRT_REQUEST_TYPES WHERE REQUEST_TYPE_NAME IN('<Request_Type_Name>'))
)
)
LOOP
update knta_parameter_set_fields set SEARCHABLE_FLAG = i.DISPLAY_FLAG WHERE
parameter_set_field_ID =
i.PARAMETER_SET_FIELD_ID;
END LOOP;
commit;
EXCEPTION
WHEN others then
rollback;
dbms_output.put_line ('Update of the Field Security Tables
Failed :'sqlcode':'sqlerrm );
END
/
Notice that the name of the request type to work on is hardcoded in the procedure. One enhancement I would suggest is -- make the procedure accept the name of the request type to set the flag in. The script is straight-forward, so I will not include an explanation. Hopefully, you can use it.
- Ranjeet Rain
0 Comments:
Post a Comment
<< Home