Collection datatype FAIL

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
sinys
Posts: 186
Joined: Tue 21 Feb 2012 03:44

Collection datatype FAIL

Post by sinys » Thu 07 Aug 2014 00:21

ODAC 9.3.10 XE2 Oracle 11g

Code: Select all

  OraSession1.ConnectString := 'Login Prompt=False;User ID=system;Password=manager';
  OraSession1.Connect;

  OraQuery1.SQL.Text := 'select cast(multiset(select level from dual connect by level<=10)as sys.ku$_objnumset) from dual';
  OraQuery1.Open;

  ShowMessage(IntToStr(OraQuery1.FieldCount));
Function ShowMessage return 0 (ZERO), why? I think this is error.

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

Re: Collection datatype FAIL

Post by AlexP » Fri 08 Aug 2014 05:44

Hello,

Such behaviour is related to the TDataSet.CreateFields method implementation in Delphi. The field type in your example is ftDataSet. In this case, a field is created if the DataSet ObjectView property is set to TRUE. So to resolve the problem, you need either set ObjectView to TRUE or create the Persistent Field in the design time.

sinys
Posts: 186
Joined: Tue 21 Feb 2012 03:44

Re: Collection datatype FAIL

Post by sinys » Thu 14 Aug 2014 16:10

But in this mode I see ftADT field like 1 field, but I want to see it like ObjectView = False. Make individual setting for it, please.

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

Re: Collection datatype FAIL

Post by AlexP » Fri 15 Aug 2014 09:18

We cannot change the ObjectView property value to True by default for ftDataSet fields, as this will cause changes in behaviour and errors in applications of our components users. If you have a Source Edition, we can show you where to add necessary changes.

sinys
Posts: 186
Joined: Tue 21 Feb 2012 03:44

Re: Collection datatype FAIL

Post by sinys » Fri 15 Aug 2014 15:27

I have Source Edition, but I don't want to change the source code of components in every new version. I don't propose to change the behavior of the ObjectView property, I ask you to add new property like FlatADTView (default false for not changing standard behavior of TOraQuery).
Example:

Code: Select all

create or replace type ComplexType as object(
x varchar2(100),
y varchar2(100)
);
/
---------
OraQuery1.SQL.Text := 'select ComplexType(CODE, name) A from TEST';
OraQuery1.ObjectView := True;
OraQuery1.FlatADTView := True; (new property)
OraQuery1.Open;
And I want to see:

Code: Select all

A.X | A.Y
1   |  2
3   |  4
like OraQuery1.ObjectView := False but this variant friendly for collections datatype.

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

Re: Collection datatype FAIL

Post by AlexP » Mon 18 Aug 2014 10:25

You can leave a suggestion to implement this feature at our uservoice page: http://devart.uservoice.com/forums/1046 ... components . Terms of the implementation will depend on the number of voices at Uservoice.

sinys
Posts: 186
Joined: Tue 21 Feb 2012 03:44

Re: Collection datatype FAIL

Post by sinys » Mon 18 Aug 2014 12:43

I added my request http://devart.uservoice.com/forums/1046 ... latadtview and some my collegs and clients voited for it already. But I think we are more speaking about it that doing it, because I asked about it long time ago http://forums.devart.com/viewtopic.php?f=5&t=28337 http://forums.devart.com/viewtopic.php?f=5&t=24825

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

Re: Collection datatype FAIL

Post by AlexP » Thu 21 Aug 2014 07:42

We implement new features depending on their complexity and relevance. These features are included to our ODAC development roadmap, however, their implementation is not planned for the nearest future.

sinys
Posts: 186
Joined: Tue 21 Feb 2012 03:44

Re: Collection datatype FAIL

Post by sinys » Thu 21 Aug 2014 13:58

Ok, please, show me what I must to change in source code for achive above behavior.

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

Re: Collection datatype FAIL

Post by AlexP » Tue 26 Aug 2014 08:24

To solve the problem, you should set the ObjectView property to True in the TOraDataSet.Create class constructor:

Code: Select all

constructor TOraDataSet.Create(Owner: TComponent);
begin
  inherited Create(Owner);

  CheckMode := cmNone;
  FSequenceMode := smPost;
  ObjectView := True;
{$IFNDEF FPC}
  NestedDataSetClass := TOraNestedTable;
{$ENDIF}
end;

sinys
Posts: 186
Joined: Tue 21 Feb 2012 03:44

Re: Collection datatype FAIL

Post by sinys » Tue 26 Aug 2014 17:00

Code: Select all

constructor TOraDataSet.Create(Owner: TComponent)
..
  ObjectView := True;
This mean that all TOraDataSet in my applications will have this behavior but I want this behavior only for 2 datasets in one of my application.

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

Re: Collection datatype FAIL

Post by AlexP » Wed 27 Aug 2014 11:33

Yes, this modification will affect all the fields of this type.

sinys
Posts: 186
Joined: Tue 21 Feb 2012 03:44

Re: Collection datatype FAIL

Post by sinys » Wed 27 Aug 2014 12:15

Could you please show me variant that I can use to 1-2 OraQuery only?

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

Re: Collection datatype FAIL

Post by AlexP » Thu 04 Sep 2014 11:57

Even if you set the ObjectView property in the constructor to True, this property will also be set to True in the DataSet, that own this field. Therefore you can just set the ObjectView property to True of the required DataSets.

Post Reply