Answers for "SQL dynamic SQL and stored procedures and oracle"

SQL
0

oracle procedure dynamic sql

CREATE OR REPLACE PROCEDURE oracle_runtime_query_pcd IS
     TYPE ref_cursor IS REF CURSOR;
     l_cursor        ref_cursor;
     v_query         varchar2(5000);
     v_name          varchar2(64);
BEGIN
     v_query := 'SELECT name FROM employee WHERE employee_id=5';
     OPEN l_cursor FOR v_query;
     LOOP
        FETCH l_cursor INTO v_name;
        DBMS_OUTPUT.put_line(v_name);
        EXIT WHEN l_cursor%NOTFOUND; 
     END LOOP;
     CLOSE l_cursor;
END;
Posted by: Guest on August-15-2021

Code answers related to "SQL dynamic SQL and stored procedures and oracle"

Code answers related to "SQL"

Browse Popular Code Answers by Language