在包中,我们如何使用PLSQL创建嵌套函数

时间:2014-10-10 10:43:07

标签: oracle plsql

我试图创建一个包。并在包体中我定义了一个function.inside我试图创建另一个函数的功能。我使用了这个逻辑,因为我需要在我的程序中调用该函数。你可以帮助我。

create or replace package L2C_pkg_limit as

  function GET_CUST_PROBLEM_DETAILS return number;

end L2C_pkg_limit;

create or replace package body L2C_pkg_limit as

create or replace function nested GET_CUST_PROBLEM_DETAILS return number
is
   p_cust_diagnostic_cursor_lmt constant number(2)  :=1;

     function p_cust_diagnostic_cursor_lmt return number
     is
     begin
       return   p_cust_diagnostic_cursor_lmt;     
     end; 

   begin
     return   p_cust_diagnostic_cursor_lmt;    
   end nested  GET_CUST_PROBLEM_DETAILS;  
end;

1 个答案:

答案 0 :(得分:0)

  1. 不要在程序包正文中使用create or replace - 只需使用FUNCTION关键字声明该函数。

  2. 没有关键字"嵌套"在Oracle中嵌套函数只是在另一个函数或过程的声明部分中声明的函数。

    create or replace package body L2C_pkg_limit as
    
      function GET_CUST_PROBLEM_DETAILS return number
      is
      ...
    
相关问题