Oracle PLSQL Demo - 31.执行动态SQL拿一个返回值

DECLARE

    v_sql   VARCHAR2(1000) := '';

    v_count NUMBER;

BEGIN

    v_sql := v_sql || 'select count(1) from scott.emp t';



    EXECUTE IMMEDIATE v_sql

        INTO v_count;

    dbms_output.put_line(v_count);

END;

 

你可能感兴趣的:(oracle)