Print Thread
Page 3 of 3 1 2 3
Re: How to update SDO_GEOMETRY column
#5972 03/01/04 02:48 AM
Joined: Nov 2003
Posts: 89
Germany
A
al0 Offline
Member
Offline
Member
A
Joined: Nov 2003
Posts: 89
Germany
[quote]Originally posted by Marco Kalter:
I will post an example shortly that will clarify this. [/quote]Might I remeber about that example?

Re: How to update SDO_GEOMETRY column
#5973 03/01/04 10:48 PM
Joined: Aug 1999
Posts: 22,208
Member
Offline
Member
Joined: Aug 1999
Posts: 22,208
Oops, sorry, I forgot. I will get round to this shortly.


Marco Kalter
Allround Automations
Re: How to update SDO_GEOMETRY column
#5974 03/02/04 03:11 AM
Joined: Nov 2003
Posts: 89
Germany
A
al0 Offline
Member
Offline
Member
A
Joined: Nov 2003
Posts: 89
Germany
[quote]Originally posted by Marco Kalter:
Oops, sorry, I forgot. I will get round to this shortly. [/quote]Thanks.
I sincerely hope for it.

Re: How to update SDO_GEOMETRY column
#5975 03/04/04 06:31 PM
Joined: Aug 1999
Posts: 22,208
Member
Offline
Member
Joined: Aug 1999
Posts: 22,208
The standard TOracleDataSet functionality for collections is based on a master/detail relation. The table of the master dataset contains one or more collection columns or attributes, that do not necessarily have to be included in the query (for efficiency reasons they can be omitted). The collection can be displayed in a detail dataset that contains a query for a collection column or attribute of the current master record. Lets assume a ROOMS table that contains a RESERVATIONS nested table column. The detail dataset query will be something like this:
Code
select * from table(select m.reservations 
                    from rooms m 
                    where m.room_number = :room_number)
The key query is the single record subselect that returns the collection:
Code
select m.reservations 
from rooms m 
where m.room_number = :room_number
This is the query that returns a single collection column for a single record. If you want to view a collection in a dataset, you must create such a query at design-time or at run-time. It doesn't have to be a master/detail setup either. Let's assume you have presented the user with a selection of rooms, and the user wants to view the reservations for room '13b'. All you need to do is present the result set of the following query:
Code
select * from table(select m.reservations 
                    from rooms m 
                    where m.room_number = '13b')
Or, to make it updateable:
Code
select t.*, rowid from table(select m.reservations 
                             from rooms m 
                             where m.room_number = '13b') t
As you can see, there is no master/detail setup necessary. All that is required is that you know the query that returns the collection you want to view or edit.

I hope this helps.


Marco Kalter
Allround Automations
Re: How to update SDO_GEOMETRY column
#5976 03/04/04 08:58 PM
Joined: Nov 2003
Posts: 89
Germany
A
al0 Offline
Member
Offline
Member
A
Joined: Nov 2003
Posts: 89
Germany
[quote]Originally posted by Marco Kalter:
All that is required is that you know the query that returns the collection you want to view or edit.

I hope this helps.
[/quote]I have written in my post that asked for sample code
[quote]
I wish to note that nor the select statement nor types in collections are known in advance.
[/quote]So your sample is of no use for me, sorry.
I have absolutely no control over selects - I have do the following:

  • obtain select from outside
  • execute it
  • check if any collections are present
  • show collections from current records in data-aware controls


It quite possible that collections just can not be obtained with separate selects (they may be results of function calls in the select list and so on).

I have to mention that I have tried this with trial version of ODAC - it is piece of cake.

Page 3 of 3 1 2 3

Moderated by  support 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.1.33 Page Time: 0.033s Queries: 14 (0.009s) Memory: 2.5375 MB (Peak: 3.0378 MB) Data Comp: Off Server Time: 2024-05-05 21:52:22 UTC
Valid HTML 5 and Valid CSS