--动态执行1
create or replace function test1 return varchar2 as
    strsql varchar2(200);
begin
    execute immediate 'update fnd_user a set a.description=''OK'' where a.user_id=1055';  --动态执行.
    commit;
    return sqlerrm;
    exception
        when others then
           return sqlerrm;
end;
--DBMS_SQL的执行:
create or replace function test return varchar2 as
    v_cursor number;
    v_string varchar2(200);
    v_row number;
begin
    v_cursor:=dbms_sql.open_cursor;
    v_string:='create table testdb (text varchar2(200))';
    dbms_sql.parse(v_cursor,v_string,dbms_sql.native);
    v_row:=dbms_sql.execute(v_cursor);
    dbms_sql.close_cursor(v_cursor);
    return ('成功执行'||v_row||'行!');
    exception
        when others then
            dbms_sql.close_cursor(v_cursor);
            return ('执行失败!'||sqlcode||sqlerrm);
            raise;
end;--PL/SQL用户指南与参考   一书中有的,