oracle动态执行sql
DECLARE V_SQL CLOB; V_NAME VARCHAR2(200); BEGIN -- 定义SQL V_SQL := 'SELECT NAME FROM SYS_USER_T WHERE ROWNUM = 1'; -- 执行SQL EXECUTE IMMEDIATE V_SQL INTO V_NAME; -- print DBMS_OUTPUT.PUT_LINE(V_NAME); END;