How I may see rowid?

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

How I may see rowid?

Post by sinys » Fri 03 Aug 2012 07:10

Delphi XE2, ODAC 8.2.7

Code: Select all

OraQuery1.Sql.text := 'select t.rowid, t.rowid as "myrowid", t.* from username.tablename t';
OraQuery1.Open;
I see all columns (t.*) without 2 rowid columns (rowid and "myrowid") in DBGrid.
What I did not do?
Or this is bug?

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

Re: How I may see rowid?

Post by AlexP » Fri 03 Aug 2012 08:46

hello,

Since this field is "service", its visible property is set to False, if you want to display such fields, you should add these fields in the editior:
OraQuery.Fields - > Add All Fields

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

Re: How I may see rowid?

Post by sinys » Fri 03 Aug 2012 10:25

My dataset is dynamic and sql statement in this dataset can be any, and should not be have design time fields.

1) How I can do this in runtime after dataset.open?
2) May be necessary to add a property for this (ShowServiceFields)?

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

Re: How I may see rowid?

Post by AlexP » Fri 03 Aug 2012 11:36

hello,

1) For displaying this fields after opening the table, you should set the Visible property of this fields to true

OraQuery1.Open;
OraQuery1.FieldByName('ROWID').Visible := true;

2) We will review the possibility to add such option in the future.

dados
Posts: 82
Joined: Thu 18 Aug 2005 14:06

Re: How I may see rowid?

Post by dados » Mon 01 Sep 2014 15:56

Hi AlexP,

Have you guys created anything to allow "service fields" to have the visible property set to true by default?

And also is there a way to check if a field is a service field?
If I execute a statement like this "select rowid as RW from dual" you guys know that RW is a alias for the service field rowid.

Is there a way to know original field name and alias name?

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

Re: How I may see rowid?

Post by AlexP » Tue 02 Sep 2014 12:49

Hello,

To retrieve the real field name, you can use the following code:

Code: Select all

TDBAccessUtils.GetIRecordSet(OraQuery1).Fields[0].ActualName;
We have added the HideRowId option (True by default), that is responsible for displaying the ROWID field. This option will be included in the next version..

dados
Posts: 82
Joined: Thu 18 Aug 2005 14:06

Re: How I may see rowid?

Post by dados » Tue 02 Sep 2014 14:24

Excellent thanks

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

Re: How I may see rowid?

Post by AlexP » Thu 04 Sep 2014 11:14

If you have any further questions, feel free to contact us.

Post Reply