Page 1 of 1

Access Violation for procedure which returns cursor in param

Posted: Sat 18 Jan 2014 20:36
by Traptak
Hello,

I have problem with ODAC 9.2.5, again. :( This time Access Violation exception is raised when I try to execute twice or more time procedure which returns cursor ref in params. To reproduce this problem create the simplest procedure:

Code: Select all

create or replace package system.t_test is

  type rc_adnotacja is record (
    lp_tmp          number(6),
    wad_id          u_eks.t_wagony_adnotacje.wad_id%type,
    wad_nadawca     u_eks.t_wagony_adnotacje.wad_nadawca%type,
    wad_tresc       u_eks.t_wagony_adnotacje.wad_tresc%type);

  type tb_adnotacje is table of rc_adnotacja;

  type cr_adnotacje is ref cursor return rc_adnotacja;
end;

create or replace package body system.t_test is
end;

create or replace procedure sp_Proc(
    o_akt_hamul_z    out integer,
      -- Dane o adnotacjach dotyczących wagonu
    io_adnotacje     in out system.t_test.cr_adnotacje)
  is
  begin
    open io_adnotacje for
      select
        1, 1, null, null
        from dual;
  end;


Then create simple Delphi project: OraSession + OraStoredProc components. Now run the code:

Code: Select all

  OraSession1.Connect;
  OraStoredProc1.StoredProcName := 'system.sp_proc';
  OraStoredProc1.Prepare;
  OraStoredProc1.Open;
  OraStoredProc1.Close;
  OraStoredProc1.Open;
On second Open call Access Violation exception is raised. Of course I can call UnPrepare after Close and then everything works correctly, but I want to work with prepared procedure. I have test it with Delphi XE4, Oracle 10g XE and ODAC 9.2.5.

regards Adam Siwoń

Re: Access Violation for procedure which returns cursor in param

Posted: Mon 20 Jan 2014 10:40
by AlexP
Hello,

Thank you for the information, we have reproduced the problem and will try to fix it in the nearest future.