Not show Nested Tables fields

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

Not show Nested Tables fields

Post by sinys » Sun 02 Sep 2012 17:08

ODAC 8.2.8

I'm do

Code: Select all

CREATE TYPE XX_TYPE_CHAIR IS TABLE OF VARCHAR2(100);
/
CREATE TABLE CHAIRS (ID NUMBER, CHAIR_NAME  XX_TYPE_CHAIR)
   NESTED TABLE CHAIR_NAME STORE AS NESTED_CHAIRS;

select * from chairs t;
"select" show only ID field, where "CHAIR_NAME" field?

bork
Devart Team
Posts: 649
Joined: Fri 12 Mar 2010 07:55

Re: Not show Nested Tables fields

Post by bork » Mon 03 Sep 2012 13:11

Hello

To show the CHAIR_NAME field in DBGrid, you should set TOraQuery.ObjectView = True. But if you want to see each element of the CHAIR_NAME field, then you should use the TOraNestedTable component and additional DBGrid that will be linked to TOraNestedTable.

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

Re: Not show Nested Tables fields

Post by sinys » Wed 05 Sep 2012 07:08

But with TOraQuery.ObjectView = True
select MyType(field1, field2) from ...
show as 1 field,
How show MyType as many fields and show nested tables fields?
Last edited by sinys on Thu 06 Sep 2012 06:39, edited 1 time in total.

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

Re: Not show Nested Tables fields

Post by sinys » Thu 06 Sep 2012 06:38

up

bork
Devart Team
Posts: 649
Joined: Fri 12 Mar 2010 07:55

Re: Not show Nested Tables fields

Post by bork » Thu 06 Sep 2012 10:29

As I wrote before, you should use TOraNestedTable and an additional DBGrid to get all values that are stored in the nested table fields. Independently on TOraQuery.ObjectView (True or False), it is unavailable to get all values for nested table fields in the same DBGrid. To help you resolve this issue we need more information: please describe what are you going to do with nested table fields?

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

Re: Not show Nested Tables fields

Post by sinys » Thu 06 Sep 2012 11:40

I mean that if I set TOraQuery.ObjectView = True then "create type MyType ..."
"select MyType(field1, field2) from ..." return 1 field as TADTField
I want to see from "select CHAIR_NAME, MyType(ID, AA, BB) from ..."
CHAIR_NAME, MyType.ID, MyType.AA, MyType.BB
but I see only CHAIR_NAME and MyType (as TADTField)

bork
Devart Team
Posts: 649
Joined: Fri 12 Mar 2010 07:55

Re: Not show Nested Tables fields

Post by bork » Fri 07 Sep 2012 14:08

Now there is no possibility to set object view for one field, but not to set for another. We will investigate the possibility of adding this feature in one of the next builds/versions of ODAC. But now we recommend to use TOraNestedTable and separate DBGrid to show nested table fields.

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

Re: Not show Nested Tables fields

Post by sinys » Sun 30 Jun 2013 21:20

Delphi XE2, ODAC 9.0.1,
Error: Access violation at address 61055D54 in module 'oracommon11.dll'. Write of address 10000000.
demo

Code: Select all

OraQuery1.Sql.Text := 'select * from chairs t'; // table have 2 records
OraQuery1.Open;
OraQuery1.Next; // - OK
OraQuery1.Close;
OraQuery1.FetchRows := 1000;
OraQuery1.Options.ScrollableCursor := True;
OraQuery1.Open; 
OraQuery1.Next; // - raise exception 

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

Re: Not show Nested Tables fields

Post by AlexP » Mon 01 Jul 2013 11:40

Hello,

Thank you for the information, we have reproduced the problem and will try to fix it as soon as possible.

Post Reply