Create Manual Form and Process On Oracle Apex
Create Manual Form and Process On Oracle Apex
Topic Introduction: In this tutorial, we will show how to create a manual form and customize the process to insert, update, and delete in the Oracle Apex.
1. Create a Form using wizard and decorate the page item as you want to see
2. Change Process target type PL/SQL type
3. Write this PL/SQL Block
DECLAREA NUMBER;beginIF :P86_DEPARTMENT_ID IS NULL THENSELECT NVL(MAX(DEPARTMENT_ID),0)+1 INTO :P86_DEPARTMENT_ID FROM OEHR_DEPARTMENTS;insert into OEHR_DEPARTMENTS(DEPARTMENT_ID,DEPARTMENT_NAME,MANAGER_ID,LOCATION_ID)values (:P86_DEPARTMENT_ID,:P86_DEPARTMENT_NAME,:P86_MANAGER_ID,:P86_LOCATION_ID);ELSEupdate OEHR_DEPARTMENTSsetDEPARTMENT_NAME=:P86_DEPARTMENT_NAME,MANAGER_ID=:P86_MANAGER_ID,LOCATION_ID=:P86_LOCATION_IDwhere DEPARTMENT_ID = :P86_DEPARTMENT_ID;END IF;end;
If you want to delete any data you can use another PL/SQL block using the delete statement against DELETE Button. It will be a separate process and the server site condition when button press will be the Delete button. Code Example
BEGINDELETE FROM OEHR_DEPARTMENTSWHERE DEPARTMENT_ID = :P86_DEPARTMENT_ID;END;
No comments