EXECUTE IMMEDIATE
Note:- This type of Dynamic SQL would not work in the 10.7 version Database.For the Select statementNote:- I have created the sample Examples code based on the EMP and DEPT table in the scott schema.Example:-———-DECLAREL_DEPTNO NUMBER DEFAULT 10;L_SAL NUMBER; BEGIN EXECUTE IMMEDIATE ‘select max(sal) from emp where deptno = :l_deptno’INTO L_SALUSING L_DEPTNO;DBMS_OUTPUT.PUT_LINE(L_SAL);END;For the Insert statementNote:- I have created […]
Recent Comments