Manually Data Insert, Update, Delete On Oracle Apex Interactive Grid
How to Manually Insert, Update, and Delete On Oracle Apex Interactive Grid
Topic Introduction: In this tutorial, we will learn how to manually insert, update, and delete data from Interactive Grid in Oracle Apex. To complete the manual write process for inserting, editing, and deleting data we need to change the automated created process.
1. Go to the automated created process to insert, update, and delete data.
2. Go to Process Properties Setting ==> Target Type: PL/SQL Code.
3. Write your PL/SQL code on PL/SQL Code to Insert/Update/Delete Box according to the below structure.
Example:
DECLAREA NUMBER;begincase :APEX$ROW_STATUSwhen 'C' thenSELECT NVL(MAX(EMPLOYEE_ID),0)+1 INTO A FROM OEHR_EMPLOYEES;insert into OEHR_EMPLOYEES(EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID)values (A,:FIRST_NAME,:LAST_NAME,:EMAIL,:PHONE_NUMBER,:HIRE_DATE,:JOB_ID,:SALARY,:COMMISSION_PCT,:MANAGER_ID,:DEPARTMENT_ID);when 'U' thenupdate OEHR_EMPLOYEESset FIRST_NAME= :FIRST_NAME,LAST_NAME= :LAST_NAME,EMAIL= :EMAIL,PHONE_NUMBER= :PHONE_NUMBER,HIRE_DATE= :HIRE_DATE,JOB_ID= :JOB_ID,SALARY= :SALARY,COMMISSION_PCT= :COMMISSION_PCT,MANAGER_ID=:MANAGER_ID,DEPARTMENT_ID= :DEPARTMENT_IDwhere EMPLOYEE_ID = :EMPLOYEE_ID;when 'D' thendelete OEHR_EMPLOYEESwhere EMPLOYEE_ID = :EMPLOYEE_ID;end case;end;
Helpful post.
ReplyDelete