Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2008/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql 有人能解决我的“无法访问串行可重用包问题”吗?_Sql_Oracle_Stored Procedures - Fatal编程技术网

Sql 有人能解决我的“无法访问串行可重用包问题”吗?

Sql 有人能解决我的“无法访问串行可重用包问题”吗?,sql,oracle,stored-procedures,Sql,Oracle,Stored Procedures,在处理下面的包时,当我执行p_proc3时,我收到错误消息 ORA-06534:无法访问串行可重用包。需要帮助解决此问题 我读 SERIALLY_Reusables pragma表示仅在对服务器的一次调用期间需要包状态,例如,对数据库的OCI调用或通过数据库链接的存储过程调用。在这个调用之后,可以重用包变量的存储,从而减少长时间运行会话的内存开销 但我们刚刚了解到,这个包实例将不在缓冲区内存中 代码如下 get_迭代名称和get_itr_nm是否相同?如果是,而您只是键入了错误的函数名,那么错误

在处理下面的包时,当我执行p_proc3时,我收到错误消息 ORA-06534:无法访问串行可重用包。需要帮助解决此问题

我读 SERIALLY_Reusables pragma表示仅在对服务器的一次调用期间需要包状态,例如,对数据库的OCI调用或通过数据库链接的存储过程调用。在这个调用之后,可以重用包变量的存储,从而减少长时间运行会话的内存开销

但我们刚刚了解到,这个包实例将不在缓冲区内存中

代码如下


get_迭代名称和get_itr_nm是否相同?如果是,而您只是键入了错误的函数名,那么错误是因为您试图在SQL语句SELECT语句中引用串行可重用包的函数,在本例中为c1游标。我认为如果您让代码在一次调用中从串行可重用包中获取所有数据,它会工作的。get_iteration_name和get_itr_nm是否相同?如果是,而您只是键入了错误的函数名,那么错误是因为您试图在SQL语句SELECT语句中引用串行可重用包的函数,在本例中是c1游标。我认为,如果您让代码在一次调用中从串行可重用包中获取所有数据,它将起作用。
create or replace PACKAGE BODY COG_MIGR_TRNS
as
  PRAGMA SERIALLY_REUSABLE;

  function get_itr_nm return varchar2
  as
    itr_name varchar2(30);
    cursor c1 is
      select value 
        from params where obj_id =45877; 
  begin
    open c1;
    fetch c1 into itr_name;
    close c1;
    return itr_name;
  EXCEPTION
    WHEN OTHERS THEN RAISE;
  end;

  -----------------------------------

  PROCEDURE P_proc1 
  IS
    v_nm varchar(100);
    cursor c1 is
      select get_iteration_name() 
        from dual;
  BEGIN
    open c1;
    fetch c1 into v_nm;
    close c1;
    <Some more code Here using v_nm>
  EXCEPTION
    WHEN OTHERS THEN RAISE; 
  end;

  ------------------------

  PROCEDURE P_proc2 
  IS
    v_nm varchar(100);
    cursor c1 is
    select get_iteration_name() 
      from dual;
  BEGIN
    open c1;
    fetch c1 into v_nm;
    close c1;
    <Some more code Here using v_nm>
  EXCEPTION
    WHEN OTHERS THEN RAISE;
  end;

  -------------------
  PROCEDURE P_proc3 
  IS
    v_nm varchar(100);
    cursor c1 is
      select get_iteration_name() 
        from dual;
  BEGIN
    P_Proc1;
    P_Proc2;
  EXCEPTION
    WHEN OTHERS THEN RAISE;
  end;