Accessing Oracle spatial objects (SDO_GEOMETRY) through ODBC/OLEDB

Hello.
I tried googling and reading through these forums and Oracle documentation, but I'm still uncertain on this question:
Are Oracle spatial objects (of type SDO_GEOMETRY) accessible through ODBC and/or OLE DB drivers? Can I retrieve them with SELECT clause? Can I write them to database?
I'm limited to these options because I'm developing Delphi application based on ADO and it must work with different DB servers. However I certainly don't want to implement different ways of accessing database for each server.
If geometry objects aren't suported by ODBC/OLEDB, is there any way to convert SDO_GEOMETRY to (and from) BLOB or string or whatever, so I can read and write them like a normal data field?
Thanks in advance.
Edited by: user13816863 on 25.01.2011 20:35
Edited by: user13816863 on 25.01.2011 21:57

The SDO_UTIL package has lots of options to help output spatial data to other formats, and you may be able to use some of them to help.
Some that come to mind are:
SDO_UTIL.TO_WKTGEOMETRY
SDO_UTIL.TO_GMLGEOMETRY
SDO_UTIL.TO_KMLGEOMETRY
This is covered in chapter 32 of the Oracle® Spatial Developer's Guide 11g Release 2 (11.2).

Similar Messages

  • Oracle Spatial Object types in Designer 6

    Hi all,
    I'm trying to design a database that uses the new Oracle Spatial Object types (MDSYS.SDO_GEOMETRY) etc. I have been able to capture the object types from Oracle8i but when i try to save the design in the repository it fails. I am assuming that the version of Oracle Designer I am using does not support MDSYS.SDO_GEOMETRY. Is this correct and if so what version of Designer should I be using?
    Martin

    Hi Saso,
    I'm sorry I don't have any help for you but maybe yo can answer a question for me relating to sdo_geometry. I'm trying to capture a database schema which contains tables with sdo_geometry columns & this fails because I don't have that object defined.
    So how do I access the Oracle Object Types branch to define MDSYS.SDO_GEOMETRY? Is it in the object navigator or designer?
    Thanks,
    Jim Greetham

  • Oracle Spatial Object

    I have more than 2 geographical points In USA saved in oracle DB using geometry object...
    are there any function in Oracle Spatial Object that gives me the shortest route to go through all theses geographical points

    You would need to create a network with all of your point geometries as nodes and lines as links.  See...
    Oracle® Spatial Topology and Network Data Models Developer's Guide
    11g Release 2 (11.2) Part II
    Once you do that you can use it to solve your problem (traveling salesman).

  • INVALID Oracle Spatial objects

    Hi,
    Me also facing same issue after upgrading the database from 11g R1 to 11g R2. can you please tell how to enable the spacial from invalid to valid .
    Regards,
    Ram

    Pl post details of OS version. Were these objects invalid in the source database ? What options have been enabled in 11gR1 and 11gR2 ?
    How To Validate Oracle Spatial in the DBA_REGISTRY (Doc ID 1100898.1)
    How To Diagnose Components With NON VALID Status In DBA_REGISTRY After an Upgrade (Doc ID 753041.1)
    HTH
    Srini

  • Accessing Oracle8i Spatial Objects

    Friends,
    Could anyone suggest me any API so that I can access Spatial data using C++ API?
    I mean, I am searching an alternative for SDE C API.
    Bye,
    Srikrishna

    The SDO_UTIL package has lots of options to help output spatial data to other formats, and you may be able to use some of them to help.
    Some that come to mind are:
    SDO_UTIL.TO_WKTGEOMETRY
    SDO_UTIL.TO_GMLGEOMETRY
    SDO_UTIL.TO_KMLGEOMETRY
    This is covered in chapter 32 of the Oracle® Spatial Developer's Guide 11g Release 2 (11.2).

  • How to access Oracle forms 11g application through IE 10 Browser

    Hi There,
    Application Server Forms and Reports 11.2.0.2 is deployed on weblogic server on OS windows 7.
    How to access my application through IE 10 where OS Wondows 8?
    Regards,
    Asik

    does it work with firefox or chrome?
    You will find out you deeply have to know formsweb.cfg
    However, ie 10 in general with oracle is not a good plan. E.g.:
    jpi_classid=clsid:8AD9C840-044E-11D1-B3E9-00805F499D93
    I hear ie10 is being deployed to windows 7 and and ie11 is in the works.
    which is why I say, oracle needs to develop their own program for launching forms. It doesn't have to be
    full featured browser, just enough to run forms. Hint hint hint: you can get the source code of firefox, change it
    and compile it. (remove their logos and so on.)

  • Using OFFLINE_INSTANTIATION with a spatial object - SDO_GEOMETRY type

    Hello
    I am looking for guidance on the usage of DBMS_REPCAT_RGT.INSTANTIATE_OFFLINE for a table object with an SDO_GEOMETRY
    column defined.
    The table is:
    SQL> descr jtx.jtx_jobs_aoi
    Name Null? Type
    OBJECTID NOT NULL NUMBER(38)
    JOB_ID NUMBER(10)
    SHAPE MDSYS.SDO_GEOMETRY
    SE_ANNO_CAD_DATA BLOB
    The mview is defined as:
    CREATE MATERIALIZED VIEW jtx.JTX_JOBS_AOI REFRESH FAST WITH PRIMARY KEY FOR UPDATE AS
    SELECT * FROM JTX.JTX_JOBS_AOI@ncgsdb_master_s;
    And the command we are using is:
    SQL> SET SERVEROUTPUT ON
    SQL>
    SQL> DECLARE
    2 dt_num NUMBER;
    3 BEGIN
    4 dt_num := DBMS_REPCAT_RGT.INSTANTIATE_OFFLINE(
    5 refresh_template_name => 'jtx_refg_dt',
    6 user_name => 'jtx',
    7 site_name => 'NCGSDB_MVSITE1',
    8 next_date => SYSDATE,
    9 interval => 'SYSDATE + (1/96)');
    10 DBMS_OUTPUT.PUT_LINE('Template ID = ' || dt_num);
    11 END;
    12 /
    When we run this on an 11.1.0.6 database we get:
    DECLARE
    ERROR at line 1:
    ORA-30373: object data types are not supported in this context
    ORA-06512: at "SYS.DBMS_REPCAT_RGT_CUST", line 1991
    ORA-06512: at "SYS.DBMS_REPCAT_RGT", line 1330
    ORA-06512: at line 4
    Now the strange thing is this appears to work for ONLINE_INSTANTIATION.
    1. Is this supported?
    2. If so what are we doing wrong?
    Thanks
    Richard

    Here a full example with  CAST MULTISET as @PhilHerring wrote and with CAST COLLECT using the simplest possible function make_geometry:
    CREATE OR REPLACE TYPE t_sdo_geometries AS TABLE OF MDSYS.sdo_geometry;
    CREATE OR REPLACE FUNCTION make_geometry (p_points t_sdo_geometries)
      RETURN t_sdo_geometries IS
    BEGIN
      RETURN p_points;
    END;
    SELECT make_geometry (
            t_sdo_geometries (
              sdo_geometry(2001, 32774, sdo_point_type(1, 1, null), null, null),
              sdo_geometry(2001, 32774, sdo_point_type(2, 2, null), null, null),
              sdo_geometry(2001, 32774, sdo_point_type(3, 3, null), null, null),
              sdo_geometry(2001, 32774, sdo_point_type(4, 4, null), null, null)))
            AS geom
      FROM DUAL;
    WITH geoms(pcol) AS
    (SELECT sdo_geometry(2001, 32774, sdo_point_type(1, 1, null), null, null) FROM dual UNION ALL
      SELECT sdo_geometry(2001, 32774, sdo_point_type(2, 2, null), null, null) FROM dual UNION ALL
      SELECT sdo_geometry(2001, 32774, sdo_point_type(3, 3, null), null, null) FROM dual UNION ALL
      SELECT sdo_geometry(2001, 32774, sdo_point_type(4, 4, null), null, null) FROM dual)
    SELECT make_geometry(cast(multiset(select pcol from geoms a) as t_sdo_geometries)) FROM dual;
    WITH geoms(pcol) AS
    (SELECT sdo_geometry(2001, 32774, sdo_point_type(1, 1, null), null, null) FROM dual UNION ALL
      SELECT sdo_geometry(2001, 32774, sdo_point_type(2, 2, null), null, null) FROM dual UNION ALL
      SELECT sdo_geometry(2001, 32774, sdo_point_type(3, 3, null), null, null) FROM dual UNION ALL
      SELECT sdo_geometry(2001, 32774, sdo_point_type(4, 4, null), null, null) FROM dual)
    SELECT make_geometry(cast(collect(pcol) as t_sdo_geometries)) FROM geoms;
    Hope that helps
    _jum

  • Update oracle table using data through ODBC

    Hi,
    I want to update tables inside an Oracle 8i database.
    The updates depend on data in a mySql database that I want to approach using an ODBC connection.
    I cannot figure out what I need to do to select data from an ODBC source from an oracle session.
    What do I have to call this external table ...
    Edward

    The following link may be relevant. Check it out.
    http://download-east.oracle.com/docs/cd/A87860_01/doc/server.817/a76960/hs_admin.htm

  • JDBC overview to support ORACLE spatial databases

    Hello, where can I get some examples to access ORACLE SPATIAL objects from JAVA using JDBC?Does anybody now the link where can I read this.Thakx.
    Tomas Kloucek

    I have the same problem, i have been trawling through the internet trying to find
    out how to solve this problem but to know avail.

  • Oracle Spatial datatype problems - HELP!!

    Can anyone help with this problem. I am using Pro*C/C++ to create a DLL which I am then
    linking to another C based application. I am attempting to use Pro*C/C++ to read/write
    Oracle Spatial Objects. I have no problem writing Pro*C/C++ code or accessing the
    functions in the DLL. My problem is returning values from the DLL functions to my
    application. So far the only values I seem able to return are character strings.
    Below are two versions of the same function. One that returns a char string and a second
    that returns nothing. I would like the second function to work and to return an integer
    value for "g_type". Any ideas??? By the way "g_type" is the return value in question. I am
    using Oracle Pro*C/C++ 8.1.5 and the V8 Oracle Call Interface for the datatype conversion.
    Header files for the Object types have been generated by the Object Type Translator.
    THIS FUNCTION WORKS AS EXPECTED. THE PARAMETER G_TYPE RETURNS THE ANTICIPATED STRING VALUE
    int Read_Geometry
    int gid,
    char *g_type,
    char *errMsg
    char err_msg[128];
    sword retcode;
    int tester;
    size_t buf_len, msg_len;
    SDO_GEOMETRY geom = (SDO_GEOMETRY )0;
    SDO_GEOMETRY_ind geom_ind = (SDO_GEOMETRY_ind )0;
    exec sql at db_name allocate :geom:geom_ind;
    exec sql at db_name select geometry into :geom:geom_ind from test81 where gid=:gid;
    if (SQLCODE !=0)
    exec sql whenever sqlerror continue;
    buf_len = sizeof (err_msg);
    sqlglm(err_msg, &buf_len, &msg_len);
    strcpy(errMsg,err_msg);
    return ERROR;
    else
    retcode = OCINumberToInt(err,&geom->sdo_gtype, sizeof(g_type), OCI_NUMBER_SIGNED,&tester);
    if (retcode == OCI_ERROR)
    sprintf(errMsg,"Convert failed");
    return ERROR;
    else
    sprintf(g_type,"%d", tester);
    sprintf(errMsg,"gType=%s",g_type);
    return SUCCESS;
    return SUCCESS;
    THIS FUNCTION DOES NOT WORK. THE FUNCTION EXECUTES BUT THE PARAMETER G_TYPE RETURNS NOTHING?????????
    int Read_Geometry
    int gid,
    int g_type,
    char *errMsg
    char err_msg[128];
    sword retcode;
    size_t buf_len, msg_len;
    SDO_GEOMETRY geom = (SDO_GEOMETRY )0;
    SDO_GEOMETRY_ind geom_ind = (SDO_GEOMETRY_ind )0;
    exec sql at db_name allocate :geom:geom_ind;
    exec sql at db_name select geometry into :geom:geom_ind from test81 where gid=:gid;
    if (SQLCODE !=0)
    exec sql whenever sqlerror continue;
    buf_len = sizeof (err_msg);
    sqlglm(err_msg, &buf_len, &msg_len);
    strcpy(errMsg,err_msg);
    return ERROR;
    else
    retcode = OCINumberToInt(err,&geom->sdo_gtype, sizeof(g_type), OCI_NUMBER_SIGNED,&g_type);
    if (retcode == OCI_ERROR)
    sprintf(errMsg,"Convert failed");
    return ERROR;
    else
    return SUCCESS;
    return SUCCESS;
    Header file is as follows
    struct SDO_GEOMETRY
    OCINumber sdo_gtype;
    OCINumber sdo_srid;
    struct SDO_POINT_TYPE sdo_point;
    SDO_ELEM_INFO_ARRAY * sdo_elem_info;
    SDO_ORDINATE_ARRAY * sdo_ordinates;
    typedef struct SDO_GEOMETRY SDO_GEOMETRY;
    struct SDO_GEOMETRY_ind
    OCIInd _atomic;
    OCIInd sdo_gtype;
    OCIInd sdo_srid;
    struct SDO_POINT_TYPE_ind sdo_point;
    OCIInd sdo_elem_info;
    OCIInd sdo_ordinates;
    typedef struct SDO_GEOMETRY_ind SDO_GEOMETRY_ind;

    Hi,
    From a quick look I can't see anything wrong. You might want to compare this with the example in $ORACLE_HOME/md/demo/examples.
    Also, note that in 9i there will probably be an occi (C++ OCI) available, should this be useful to you.

  • Converting Spatial Objects to strings

    Hi,
    Many tools (SQL*Plus, DBVisualizer, various Python modules) seem to be able to retrieve spatial objects as strings. Is this conversion being done by each tool, or does the database know how to convert objects (at least Oracle Spatial objects) to strings?
    Is there any way to get string as the result of a query of an Oracle Spatial object with Pro*C or the other precompilers?
    Thanks for any information,
    -- Andrew Bell
    [email protected]

    Andrew
    Is your question about decoding the struct returned in an OCI, Pro*C, or SQLJ program to get at the fields of an sdo_geometry type?
    There are oci examples (readgeom.c, writegeom.c) on OTN.
    Jayant

  • Oracle Spatial system requirements

    Hi Experts,
    I have a 32bit window 2003 server with 8G memory (PAE added to *g from 2G) with 4 CPU.
    we use oracle 10GR4 suppour in stream.
    Based on application, I need to install Oracle Spatial ( Actually, I can saw Oracle Spatial object in sysaux tablespace).
    I could not find how many system resource requirement to support Oracle Spatial future.
    ALso How to check Oracle Spatial is installed into system?
    Thanks for HELP!!
    JIM

    You can see what kind of options you have with:
    select * from dba_registry;
    Do you really need Oracle Spatial or just the free subset Oracle Locator?

  • Java Visualizer for Oracle 8i Object model

    I have used the java visualizer demo version that is within Ora8iR2 but it cant work with oracle spatial object model I think this version is designed for the relational model.
    Where I can find a object model oracle spatial visualizer??
    Where I can find any oraclevector2image (jpeg or gif) traslator?
    Anybody knows whats the procedure for geolocate the address field of any other table in the database?
    null

    This is a duplicate question. Answers are in the other posting. Thanks.
    Dan

  • Oracle Spatial Datatypes and Dataguard 11g

    Hi
    Does anyone know if the following datatypes are supported in dataguard 11g for logical standby or physical standby?
    SDO_Geometry
    SDO_georaster
    thanks
    sunir

    A correction. Logical standby (SQL Apply) doesn't currently natively support spatial data types but sdo_geometry can be supported thru EDS by creating a logging table and two triggers and some manual work. Please check it out from My Oracle Support:
    Note 559353.1 - Extended Datatype Support (EDS) for SQL Apply. "Extended Datatype Support (EDS) is the ability for SQL Apply to extend support for additional datatypes that are not natively supported yet by SQL Apply. EDS relies on a new capability in Oracle Database 10g Release 2 Patch Set 3 (10.2.0.4) and Oracle Database 11g Release 1 Patch Set 1 (11.1.0.7) that allows triggers to fire on the logical standby database. "
    Note 565074.1 - EDS for SQL Apply Example - Oracle Spatial Type SDO_GEOMETRY
    thanks
    Jeffrey

  • Does Oracle Lite support Oracle Spatial

    Does anybody know whether Oracle Lite or Personal Oracle supports the Oracle Spatial plug-in. Also, for extra credit does anybody know what the difference between Personal Oracle and Oracle Lite is?
    We will be needing to provide some attribute and spatial data from our Oracle Enterprise database to several laptops for field personnel using an electronic map we developed. We would like to use a portable version of Oracle that supports Oracle Spatial objects.
    Any help would be greatly appreciated.
    Thanks
    Dan

    oh, I didn't realize it was so limited. No, that won't do. We're looking for a "mini" version of the real production database including stored code, triggers etc. Should be scaled down enough to allow rapid syncing of data and schema changes from the production (or really QA) database, but full enough to include the objects necessary to allow the developers to test their code changes to the front end applicaiton on their own environment.

Maybe you are looking for

  • Mozilla firefox won't open it comes up with mozilla crash reporter before the browser opens

    I cannot open the browser at all everytime I try and open it it comes up with crash reporter and then the browser doesn't open at all. I cannot open it in safe mode either as when I try and press shift while opening it it doesn't even come up with an

  • CS6 Fluid Layout Problems

    I'm new to coding and Dreamweaver CS6 and have been working with the fluid grid layout.  When I view the template page in Safari Preview, my website looks like the image below.  After saving and putting the files the page looks completely different w

  • Skype video call Blackmail

    I know skype cant do much about it. but firstly I'd like to suggest everyone post up all information you can regarding the pursuer so that everyone else can go on skype look them up and block/report them. Their accounts are usually fairly obvious onc

  • POS and POSDM

    Hi - what is the difference between POS and POSDM ? There are POS datasources such as 2LIS_40_REVAL etc for POS and then there are 0RT_PA_TRAN_CONTROL for POSDM ? In what ways these are related and how ? Thanks a lot.

  • Tell me the perameter to set maximum gui auto logout time for limited users

    hi gurus... i want to know the perameter to set the maximum gui auto logout time for limited users... at present i have auto logout time as 30 minutes..but i need to set the value as 10 minutes for some group of user... if any one know any perameter