說明:在修改完function或procedure (schema Browser -> copy script to an Editor Window)後,要如何測試呢?
作法:
測試function:
1. Menu -> View -> 打開DBMS Output
2. 在Editor視窗輸入如下語法:
begin
parameter := '測試資料';
dbms_output.put_line(packagename.functionname(parameter));
commit;
end;
3. return值會顯示於DBMS Output視窗上
或SELECT function FROM dual;
測試procedure:
1. schema Browser -> Tab Source上右鍵 -> Execute Procedure (或copy code到Editor執行)
2. SELECT procedure FROM dual;
參考資料:
http://stackoverflow.com/questions/4827134/how-do-i-get-the-return-value-from-a-function-in-oracle-using-toad
http://www.dotblogs.com.tw/kim/archive/2011/06/01/26827.aspx
http://blog.yam.com/csylvia/article/71505909
http://plsql-tutorial.com/plsql-passing-parameters-procedure-function.htm
http://plsql-tutorial.com/plsql-functions.htm
http://blog.yam.com/csylvia/article/71505909
http://godleon.blogspot.tw/2008/12/oracle-stored-procedures.html
沒有留言:
張貼留言