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

Similar Messages

  • 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).

  • Using Java with Oracle Spatial

    I am using the JDBC (Java classes dowloaded from
    technet.oracle.com - (sdoapi.zip)) together with Oracle Spatial
    8.1.6. I am writing a collection of Linestrings into Oracle
    Spatial using the supplied java classes(sdoapi.zip). I use the
    function createGeometryCollection(myCollection)to write the
    Linestring collection to Oracle Spatial and they are written to
    the database without error. However, when I try to read the
    object back I get the following error:
    Exception in thread "main"
    oracle.sdoapi.geom.InvalidGeometryException
    at oracle.sdoapi.adapter.AdapterSDO.importGeometry
    (AdapterSDO.java:101)
    at
    MapInfoToOracleSpatial.MapInfoToOracleSpatial.main
    (MapInfoToOracleSpatial.java:211)
    I do not have a listing of this code so can you please tell me
    what the error is (line of code) at line 211. Also, when I use
    the Oracle Spatial Index Advisor to view the spatial data, it
    only displays a quarter of the data. When I use MapInfo to view
    it's equivalent TAB (Table) file it views correctly all the
    data.
    I can't understand why this is happening because the writing to
    oracle and creation of each individual linestring does not
    throw an error. It is only when I try to read back larger
    objects from the database (2500 points) that it gives an error.
    Is there a limitation on the size one can create linestrings?
    Thanks
    Regards
    Stephen Syrett
    Mobile Telecommunications Network
    (MTN) South Africa

    Latest Oracle Openworld Spatial/MapViewer activities list:
    http://www.oracle.com/us/products/database/options/spatial/ssLINK/oow10-focuson-spatial-169204.pdf
    thanks
    LJ

  • Using Toplink with Oracle Spatial (missing right parenthesis error)

    Hi,
    I always get the following error when I try to create spatial query with toplink.
    Internal Exception: java.sql.SQLException: ORA-00907: missing right parenthesis
    Any idea ? Also, there is no trace of my point in the generated sql....
    Here is the generated query:
    SELECT ID, [...]
    FROM QUEBEC_CITY
    WHERE (MDSYS.SDO_NN(GEOMETRY, JGeometry (gtype=1, dim=2, rid=8307, NULL) = 'TRUE')
    ORDER BY ID ASC
    Here is my code... :
    double[] coord = new double[]{-71.25163d, 46.8527d};
    JGeometry point = JGeometry.createPoint(coord, 2, 8307);
    SpatialOperator nearestNeighbor = SpatialOperator.nearestNeighbor(session);
    ReadAllQuery query = new ReadAllQuery(UrbanEdgeDescriptor.class);
    ExpressionBuilder eb = query.getExpressionBuilder();
    Expression geom = eb.get("geometry");
    query.setSelectionCriteria(nearestNeighbor.buildExpression(geom, point));
    query.addAscendingOrdering("id");
    List<UrbanEdgeDescriptor> results = (List)db.getSession().executeQuery(query);
    System.out.println(results!=null);

    The problem is the toString() on JGeometry. It does not print out a complete description the database can use inline. It produces:
    JGeometry (gtype=1, dim=2, rid=8307
    To get JGeometry types to work in your queries the easiest solution is to use parameter binding so the literal representation is not used.
    Doug

  • How to use nvl with to_char on varchar data type

    Hi,
    I have the datatype as varchar in which i enter date format with timestamp.
    I am using the quey
    select nvl(:p_date,pei_attribute8) from per_people_extra_info .
    Now i need to trucate in date format as Mar,12,2011.
    I tried using
    select tochar(nvl(:p_date,pei_attribute8),'yyyymmmdd') from per_people_extra_info and getting invalid character.
    How to get the output in 'Month ddTH, YYYY' format ????
    Edited by: user12952202 on Oct 27, 2011 12:11 AM

    This will not apply for HR tables..
    I used fnd_date.canonical_to_date function and solved the issue.
    Thanks Again :)
    Edited by: user12952202 on Oct 27, 2011 2:28 AM
    Edited by: user12952202 on Oct 27, 2011 2:28 AM

  • Using EventListeners with classic Text objects

    I have created 4 classic text objects and called them Butt1 thru Butt4.
    This is so I can change the text in code from time to time.
    I want to create an event listener to pick up when the user
    a) mouses over Butt1, etc.
    b) mouses out of Butt1, etc.
    c) clicks on Butt1, etc.
    In each case I will define a function to perform actions when the
    button is moused over, moused out or clicked.
    AddEventListener(MouseEvent.CLICK, clickHandler);  does not seem to have parameters(as far as I can tell)
    to point to Butt1, etc.
    How is this done?
    Probably an elementary issue, but befuddles me.
    Thanks for help.

    Excellent!
    camelCase check!
    But how do I get access to features like text color, font size, etc.
    The Code Hints don't include anything like that.
    When I try
    Butt1.text_color = #AAEEFF;
    or
    Butt1.color = #AAEEFF;
    I get an error:
    I'm just guessing at what the name should be but What Flash/Action Script really needs
    is some way to see what methods are available for classic text fields.
    I'm sure Flash has this feature but how do I get it.
    Thanks

  • Using Airtunes with two Apple TV (HD type)

    Music breaks up sometimes when streaming to either Apple TV. Have no trouble when playing music from content stored on Apple TV HD. Any way to correct this?

    Thanks for the info.
    It turns out that the "Look for External Speakers" option in the Preferences was turned off. Without this on, the pull down menu you mentioned doesn't appear.
    Once that was switched on, the rest was easy!
    Works great too. This was one of the elements that was a great addition to the AppleTV update!

  • Mapping spatial object type

    I need to map a table with a spatial column of type MDSYS.SDO_GEOMETRY using TopLink. This type is defined as:
    CREATE TYPE SDO_GEOMETRY AS OBJECT (
    SDO_GTYPE NUMBER,
    SDO_SRID NUMBER,
    SDO_POINT SDO_POINT_TYPE,
    SDO_ELEM_INFO MDSYS.SDO_ELEM_INFO_ARRAY,
    SDO_ORDINATES MDSYS.SDO_ORDINATE_ARRAY
    Has anyone done this before, or can someone tell me how to do this? Do I need to use ConversionManager or Structure Mapping or something else?

    Can I conclude from the lack of replies that this is rather complicated?

  • 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

  • Multiple SDO_GEOMETRY Objects of type CIRCLE with the same LOCATION

    Can i have a single MERCHANT LOCATION hold multiple SDO_GEOMETRY Objects of type CIRCLE ?
    For example the use case , i need to have a SDO_GEOMETRY TYPE CIRCLE circle defined for a single MERCHANT LOCATION with a 2 Mile radius as well as a 5 Mile Radius.
    is that even possible with Spatial? I know i can add a single geometry for a merchant at once, but i want to give the user the flexibility of choosing the type of geometry for the merchant based on set of rules. hence want to check if this can be done or not?
    Thanks in Advance

    Person with no name,
    Not clear exactly what you need to do here.
    You can store two circles with the same centre in a single sdo_geometry but only if you use a polygon with the circle with the greatest radius being the outer ring and the smaller radius the inner ring.
    I have a utility in my free COGO plsql package that allows me to create circles for PLANAR data pretty easily as follows:
    -- Function...
    Create
        function CreateCircle(dCentreX in Number,
                              dCentreY in Number,
                              dRadius in Number)
        return mDSYS.sdo_geometry
        IS
          dPnt1X NUMBER;
          dPnt1Y NUMBER;
          dPnt2X NUMBER;
          dPnt2Y NUMBER;
          dPnt3X NUMBER;
          dPnt3Y NUMBER;
        BEGIN
          -- Compute three points on the circle's circumference
          dPnt1X := dCentreX - dRadius;
          dPnt1Y := dCentreY;
          dPnt2X := dCentreX + dRadius;
          dPnt2Y := dCentreY;
          dPnt3X := dCentreX;
          dPnt3Y := dCentreY + dRadius;
          RETURN MDSYS.SDO_GEOMETRY(2003,NULL,NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,4),MDSYS.SDO_ORDINATE_ARRAY(dPnt1X, dPnt1Y, dPnt2X, dPnt2Y, dPnt3X, dPnt3Y));
        End;
    select sdo_geometry(f.geom.sdo_gtype,
                        f.geom.sdo_srid,
                        sdo_point_type(f.centreX,f.centreY,null),
                        f.geom.sdo_elem_info,
                        f.geom.sdo_ordinates) as mcircle
      from (select 10 as centreX,
                   10 as centreY,
                   sdo_geom.sdo_xor(cogo.CreateCircle(10,10,2),
                                    cogo.CreateCircle(10,10,5),
                                    0.005) as geom
              from dual ) f;
    -- Results
    MCIRCLE
    SDO_GEOMETRY(2003,NULL,SDO_POINT_TYPE(10.0,10.0,NULL),SDO_ELEM_INFO_ARRAY(1,1003,2, 11,2003,2),SDO_ORDINATE_ARRAY(10.0,15.0, 5.0,10.0, 10.0,5.0, 15.0,10.0, 10.0,15.0, 10.0,8.0, 8.0,10.0, 10.0,12.0, 12.0,10.0, 10.0,8.0))(This geometry looks like a donut.)
    Note that I have included the centre coordinates in the sdo_point of the result sdo_geometry.
    To extract each ring:
    -- We need a function to return number of rings in a polygon as sdo_util.getNumElems() does not
    Create
      Function GetNumRings( p_geometry  in mdsys.sdo_geometry,
                            p_ring_type in integer /* 0 = ALL; 1 = OUTER; 2 = INNER */ )
        Return Number
      Is
        v_elements   pls_integer := 0;
        v_ring_count pls_integer := 0;
        v_etype      pls_integer;
        v_ring_type  pls_integer := case when ( p_ring_type is null OR
                                                p_ring_type not in (0,1,2) )
                                         Then 0
                                         Else p_ring_type
                                     End;
      Begin
        If ( p_geometry is not null ) Then
          v_elements := ( ( p_geometry.sdo_elem_info.COUNT / 3 ) - 1 );
          <<element_extraction>>
          FOR v_i IN 0 .. v_elements LOOP
            v_etype := p_geometry.sdo_elem_info(v_i * 3 + 2);
            If ( ( v_etype in (1003,1005,2003,2005) and 0 = v_ring_type )
              OR ( v_etype in (1003,1005)           and 1 = v_ring_type )
              OR ( v_etype in (2003,2005)           and 2 = v_ring_type ) ) Then
               v_ring_count := v_ring_count + 1;
            End If;
          END LOOP element_extraction;
        End If;
        Return v_ring_count;
      End GetNumRings;
    -- Query
    with circles as (
      SELECT SDO_GEOMETRY(2003,NULL,SDO_POINT_TYPE(10.0,10.0,NULL),SDO_ELEM_INFO_ARRAY(1,1003,2, 11,2003,2),SDO_ORDINATE_ARRAY(10.0,15.0, 5.0,10.0, 10.0,5.0, 15.0,10.0, 10.0,15.0, 10.0,8.0, 8.0,10.0, 10.0,12.0, 12.0,10.0, 10.0,8.0))
             as geom
        FROM dual
    select sdo_util.extract(a.geom,1,e.ringNo) as circle
      from circles a,
           (select level as ringNo from circles a connect by level <= GETNUMRINGS(a.geom)) e;
    -- Result
    CIRCLE
    SDO_GEOMETRY(2003,NULL,SDO_POINT_TYPE(10.0,10.0,NULL),SDO_ELEM_INFO_ARRAY(1,1003,2),SDO_ORDINATE_ARRAY(10.0,15.0, 5.0,10.0, 10.0,5.0, 15.0,10.0, 10.0,15.0))
    SDO_GEOMETRY(2003,NULL,SDO_POINT_TYPE(10.0,10.0,NULL),SDO_ELEM_INFO_ARRAY(1,1003,2),SDO_ORDINATE_ARRAY(10.0,8.0, 12.0,10.0, 10.0,12.0, 8.0,10.0, 10.0,8.0))Not sure if this helps you at all....
    regards
    Simon

  • Use of organizational unit with org. Object type

    Hi,
    In What Scenario we will use organizational unit with org. Object type .
    Regards,
    Peter Son

    This technique works by matching codes entered in customizing tables against organizational objects in the organizational plan.
          E.g. A particular Sales Area can be related to an Organizational unit that represents all people in that Sales Area.
         SAP Organizational Objects
         Organizational entities (such as sales group, Distribution Channel, or purchasing organization) are represented by object types in the Business Object  Repository.
            The indicator organizational type in their basic data defines
            such object types as SAP Organizational Objects
         For Agent Determination, relationships are created between  SAP Organizational Objects (residing in BOR)  and the  Organizational Management objects.
         The agents are found by tracing these relationships.
    Thanks and Regards,
    Prabhakar Dharmala

  • How could I Encrypt the data of SDO_GEOMETRY type using DBMS_CRYPTO package

    Hi:
    I want to Encrypt the data of SDO_GEOMETRY object type using DBMS_CRYPTO package.
    What could I do? hope anyone can help me,give me a suggestions!
    thanks in advance.
    lgs

    well, the spatial api would not be able to handle this data anymore, so what you are trying to do is converting an SDO_GEOMETRY to some cryptable user type (see http://download-uk.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_crypto.htm#sthref1506) and encrypting this.
    Before using the SDO_GEOMETRY type will have to decrypt and reconvert it again and pass it to the spatial query or function.

  • How to build a dimension witch has a column with sdo_geometry type

    hello everybody;
    i'm working with owb 11g, i have designed my dimension and also my fact table.
    in the implemnation, i have created (designed, depolyed and populated) successfully some dimenstions without any problems.
    But when i arrived to create a spatial dimension which contains a column with sdo_geometry type, i have the following error;
    Error: ORA-30373: object data types are not supported in this context
    So how can y bypasse this problem.
    Is there any tutorial to "how create spatial dimension with owb"?
    i have googled for a long time but no solution up to now
    any help will be welcome
    Thank you at advance

    Sans,
    I am no Apex expert, but with a situation as "complex" as yours, have you thought about creating a VIEW that joins these 7/8 tables, placing an INSTEAD OF trigger on that view to do all the business logic in the database, and base your application on the view?
    This is the "thick-database" approach that has been gaining momentum of late. The idea is to put your business logic in the database wherever possible, and let the application (Form, Apex, J2EE, whatever) concentrate on UI issues,

  • ORA-13050:unable to construct spatial object in using SDO_INTERSECTION

    Hi Specialists,
    I am using Oracle Spatial and getting the ORA-13050 error when using the SDO_Intersection procedure. Below are the details of this.
    Objective: To find the addresses whose boundary lie within a user defined polygon.
    Input: List of coordinates for the user defined poygon.
    Query I am using: SELECT SDO_GEOM.SDO_INTERSECTION (add.boundary, SDO_GEOMETRY(2003,8311,NULL, SDO_ELEM_INFO_ARRAY(1,1003,1),
    SDO_ORDINATE_ARRAY( 149.986507,-36.727242,149.985898,-36.726819,149.986756,-36.726512,149.987288,-36.726803,149.986507,-36.727242)), 0.000001)
    FROM address add
    WHERE add.id = '254378298'
    Error Received:
    ORA-13050: unable to construct spatial object
    ORA-06512: at "MDSYS.SDO_3GL", line 715
    ORA-06512: at "MDSYS.SDO_3GL", line 745
    ORA-06512: at "MDSYS.SDO_GEOM", line 3016
    ORA-06512: at "MDSYS.SDO_GEOM", line 3065
    Please can any one help me in this issue very urgent.
    Thanks,
    Ashish

    Hi All,
    The problem has been resolved by transforming the user defined polygon coordinates into the database specific coordinate system.
    Thanks

  • How to make use of XMLDB to process large XML and create spatial objects

    For someone new to XMLDB I find it hard to make sense of the enormous amount of information (and easy to get lost in it). So I come here to ask for directions.
    I have to build a procedure that fills a table of spatial objects based on XML input. Basically the XML contains a large amount of elements that describe the geometry type and contain the geometries coordinates. The XML can get quite large (200-300Mb).
    Somehow I have to process each element and create an sdo_geometry object.
    Now let me ask a very broad question: What would be a good way to handle this?

    I have the same question. Any news on this?
    Wijnand

Maybe you are looking for

  • Memory on my iMAC

    is it possible to upgrade the Memory on my iMAC

  • Yoga 2 Pro: No display after Windows Update failed.

    Last night windows 8.1 tried to update 7 updates when I restarted my Yoga 2 Pro laptop.  The update hung on on the first update.  In the morning when I started up, there was no display. When I plugged it into an external display only that display wor

  • Mpeg, avi, flv in AIR app

    Hello, I've created an adobe AIR application which currently utilizes the flv playback component. What I would like to know is, is it possible to somehow add functionality to play other types of video such as mpeg2 and avi as well as flv. I would lov

  • Isakmp lifetime ???

    Hi guys, I am trying to understand how vpn works and I came accross with this question. If we select preshared keys for authentication during the isakmp phase 1 and set the lifetime to 24 hours, then what is going to happen after 24 hours and the key

  • Only static IP allowed on AS ABAP & BW 7.4 SP08 on HANA?

    Hello All. I'm creating an instance on the SAP NetWeaver Application Server ABAP & SAP Business Warehouse 7.4 SP8 on SAP HANA 1.0 SP8 [Developer Edition) and when entering the general properties, the Static IP option is grayed. There is no other opti