Access Violation for procedure which returns cursor in param

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Traptak
Posts: 26
Joined: Fri 29 Jun 2007 07:15

Access Violation for procedure which returns cursor in param

Post by Traptak » Sat 18 Jan 2014 20:36

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ń

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Access Violation for procedure which returns cursor in param

Post by AlexP » Mon 20 Jan 2014 10:40

Hello,

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

Post Reply