📜  oracle 动态 select into - SQL 代码示例

📅  最后修改于: 2022-03-11 15:05:18.604000             🧑  作者: Mango

代码示例1
SET SERVEROUTPUT ON;
DECLARE
    sql_qry     VARCHAR2 (150);
    emp_tot     NUMBER(3);
BEGIN
    
    sql_qry:= 'SELECT count (*) FROM employees';
    EXECUTE IMMEDIATE sql_qry INTO emp_tot;
    DBMS_OUTPUT.PUT_LINE ('Total employees are: '||emp_tot);

END;