![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| ||||
| ||||
|
|
Hi, I have a component that uses the OCI library to do spatial index queries. The component is badly written and is based on examples. To state it shortly, our company has very little experience with oracle and OCI, and the maintenance on the component is a mess. Is it possible to rewrite these queries using some flavour of SQL? oci does use sql. |
|
If I can do this, I can connect directly to oracle using some ODBC driver Uh - oci *is* the direct way. Everything else is indirect and few |
|
and can write my queries in a more maintainable language (like c#) with normal sql techniques. If you are on the windows platform I'd not use ODBC (Microsoft discourages |
|
I have oracle 8i. You shouldn't. It's no longer supported by oracle. Going 10g isn't |
#3
| |||
| |||
|
#4
| |||
| |||
|
|
Hi Volker, Thanks for your response. My scenario is like this: We do not control the database at all. I can say that is part of a legacy system, but that is not the whole story either. We provide an application that has to make use of this database though. It was written by an amalgamation of developers that did not really understand C++ or oracle, but knew enough to get something that appears to be working. Now that the hard problems are cropping up (memory leaks and the like) I am tearing my hair out from frustration. Console yourself, a redesign is the only option. |
|
I saw from the online docs that you can query the "normal" columns from the database, and I've seen the sql. One of them might look like this: SELECT clast_id, geometry FROM map_clasts T1 WHERE MINE = 'MPONENG MINE' and SDO_RELATE(GEOMETRY, mdsys.sdo_geometry(2003,NULL,NULL,mdsys.sdo_elem_i nfo_array(1,1003,3),mdsys.sdo_ordinate_array(-100,-100,100,100)),'mask=ANYINTERACT querytype=WINDOW') = 'TRUE'; pretty standard stuff, actually. My problem here is that I want to get to the geometry information, like the types, and the ordinates and the like. So what my question should really have been is; Is there a way to query the information that is contained in the geometry type so that the results come in a table? Yes, here's an example using VBScript, OO4O and your example geometry: |
#5
| |||
| |||
|
#6
| |||
| |||
|
#7
| |||
| |||
|
|
Just to be complete, this is what I came up with. It is VB6 code, and it works ![]() Volker, it is mostly based on what you said. As you might see, I get the sdo_elem_info collection, but what does these values mean? One of my results is (1, 2, 1)... Anyway. Thanks for your help ![]() If you are telling me that you do not know the SDO geometry object |
![]() |
| Thread Tools | |
| Display Modes | |
| |