Oracle SP table type param, UniDac vs ODac

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
tcxbalage
Posts: 5
Joined: Sat 04 Apr 2020 10:45

Oracle SP table type param, UniDac vs ODac

Post by tcxbalage » Sat 04 Apr 2020 11:15

Let's say I have an ORACLE stored procedure with a table type param.

Code: Select all

create or replace type t_number_tbl is table of number;

create or replace procedure dyn_param_test_1
(
  io_params in out t_number_tbl
)
as
begin
  ...
end;
/
When I was using ODAC 10.0.2 with Delphi XE7 it was easy to manage this type of params:

Code: Select all

...
  stoProc: TOraStoredProc;
...
  stoProc.ParamByName('io_params').Length := 2;
  stoProc.ParamByName('io_params').ItemAsFloat[1] := 100;
  stoProc.ParamByName('io_params').ItemAsFloat[2] := 42;
...
Right now I'm using UniDAC 7.4.12 with Delphi 7 (ORACLE also), but unfortunatelly I haven't found any way to achieve the above described functionallity.

So, my question how can I handle Oracle table type params using UniDAC 7.4.12 + Delphi 7?

MaximG
Devart Team
Posts: 1437
Joined: Mon 06 Jul 2015 11:34

Re: Oracle SP table type param, UniDac vs ODac

Post by MaximG » Tue 07 Apr 2020 08:18

The needed feature is available in UniDAC 8.1. This code sample demonstrates it:

Code: Select all

...
  stoProc: TUniStoredProc;
...
  stoProc.Params.ValueCount := 2;
  stoProc.Params[0].Values[0].AsFloat := 100;
  stoProc.Params[0].Values[1].AsFloat := 42;
...

tcxbalage
Posts: 5
Joined: Sat 04 Apr 2020 10:45

Re: Oracle SP table type param, UniDac vs ODac

Post by tcxbalage » Tue 07 Apr 2020 10:22

Thank you for the quick response.

I already found these properties in UniDAC 7.4.12, but not works, when I try to set the ValueCount prop I got an error message:
"Data type is not allowed for a DML array."

So - if I understand you correctly - this functionallity has beeen fixed/improved in the 8.1 version?

MaximG
Devart Team
Posts: 1437
Joined: Mon 06 Jul 2015 11:34

Re: Oracle SP table type param, UniDac vs ODac

Post by MaximG » Tue 07 Apr 2020 14:00

Yes, this functionality is available in the latest versions of UniDAC

tcxbalage
Posts: 5
Joined: Sat 04 Apr 2020 10:45

Re: Oracle SP table type param, UniDac vs ODac

Post by tcxbalage » Tue 07 Apr 2020 14:06

Thanks again!

Post Reply