Header Ads

Header ADS

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




DECLARE
A NUMBER;
begin  
         IF :P86_DEPARTMENT_ID IS NULL THEN
             SELECT 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);
                     
             
        ELSE 

             update OEHR_DEPARTMENTS 
           set 
DEPARTMENT_NAME=:P86_DEPARTMENT_NAME,
MANAGER_ID=:P86_MANAGER_ID,
LOCATION_ID=:P86_LOCATION_ID
             where 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

BEGIN
    DELETE FROM OEHR_DEPARTMENTS
          WHERE DEPARTMENT_ID = :P86_DEPARTMENT_ID;
END;












No comments

Theme images by Deejpilot. Powered by Blogger.