Databases Reference
In-Depth Information
EXCEPTION WHEN OTHERS THEN
NULL; -- logging can be done here!
END;
If the intersection item P250_shuttle is called and the driving table ID is stored in
P250_id , the call to this function could look as follows:
: P250_shuttle := get_selectlist
( p_intersection_table => 'dep_pages'
, p_lookup_fk_name => 'pag_id'
, p_master_fk_name => 'dep_id'
, P_master_fk_value => :P250_id);
Beware of SQL injection and keep P250_id hidden and protected.
The procedure set_selectlist can be used to store the changes made in the shuttle
or multiselect list. We call the function On Submit - After Validations and
Computations and after that we call the DML processes generated by the wizard. Be
aware of a reset process. If such a process is present, we have to call our procedure
before the reset process. Otherwise, we lose all our changes and nothing is saved.
PROCEDURE SET_SELECTLIST
(P_LIST IN VARCHAR2
,P_INTERSECTION_TABLE IN VARCHAR2
,P_LOOKUP_FK_NAME IN VARCHAR2
,P_MASTER_FK_NAME IN VARCHAR2
,P_MASTER_FK_VALUE IN VARCHAR2
)
IS
-- Insert the selectlist value (as a list e.g. 1:2:4) into
-- the intersection table. This process fires After Submit
-- and after the wizard generated process that handles
-- inserts, updates and deletes on the master table.
l_selected APEX_APPLICATION_GLOBAL.VC_ARR2;
l_sql_statement VARCHAR2(1000);
l_id NUMBER;
l_dummy_number NUMBER;
BEGIN
-- Check if master foreign key value is a number
l_dummy_number := TO_NUMBER(p_master_fk_value);
IF p_lookup_fk_name IS NOT NULL AND
p_intersection_table IS NOT NULL AND
p_master_fk_name IS NOT NULL AND
p_master_fk_value IS NOT NULL THEN
 
Search WWH ::




Custom Search