How to create manual a master detail form with interactive grid in oracle apex

preview_player
Показать описание
#OracleApex #Sql #PLSql #masterDetail #Oracledatabase
In this video, I have explained How to create manual a master-detail form with interactive grid in oracle apex 22.2 .

CODE :
--CREATE SEQUENCE
CREATE SEQUENCE "DEPT_SEQ" MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 21 CACHE 20 NOORDER NOCYCLE NOKEEP NOSCALE GLOBAL
/
--sql select of Interactive Grid
select ROWID, EMPNO,
ENAME,
JOB,
MGR,
HIREDATE,
SAL,
COMM,
DEPTNO
from EMP where DEPTNO=:P7_DEPTNO;
--PK PROCESSES CODE
BEGIN
IF :P7_DEPTNO IS NULL THEN

:P7_DEPTNO:=DEPT_SEQ.nextval ;

END IF;
END;

--DML PROCESSES CODE FOR Interactive Grid




BEGIN
case :APEX$ROW_STATUS
when 'C' then

insert into EMP (
ENAME,
JOB,
MGR,
HIREDATE,
SAL,
COMM,
DEPTNO

)


values (
:ENAME,
:JOB,
:MGR,
:HIREDATE,
:SAL,
:COMM,
:P7_DEPTNO

)
returning ROWID into :ROWID;
when 'U' then

UPDATE EMP
set
ENAME=:ENAME,
JOB=:JOB,
MGR =:MGR,
HIREDATE=:HIREDATE,
SAL=:SAL,
COMM=:COMM
where rowid = :ROWID

AND DEPTNO=:P7_DEPTNO;
when 'D' then


delete EMP
where rowid = :ROWID AND DEPTNO=:P7_DEPTNO;

end case;

EXCEPTION
WHEN OTHERS THEN

Raise_Application_Error(-20010, sqlerrm);

end;
Рекомендации по теме