`

pl-sql中关于函数test及存储过程中调用function函数

    博客分类:
  • SQL
 
阅读更多
对于存储过程可以直接反键test

但是对于函数就要先在过程中调用,然后测试

例子:
CREATE OR REPLACE PROCEDURE erik_test(str_code out varchar2) is
a_strSql varchar2(256);
  ncount integer :=0;
begin
     a_strSql := ' select count(1) from table(F_ZTDOMESTICDEMANDAUDITS(null  ,null  ,null  ,null  ,null  ))';
         --   DBMS_OUTPUT.PUT_LINE(substr(a_strSql_Org,1,40));
         execute immediate a_strSql into ncount;

exception
  when others then
    str_code := sqlerrm;
end erik_test;

利用execute immediate 执行sql中的函数,然后测试,一步一步进入function中,就可以达到测试的目的了,若果函数名可以动态获取,就可以叫动态的调用具体的存储过程了

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics