Oracle Spatial - inserts/updates to geometry tables

I am getting the following errors when inserting into an SDO_GEOMETRY object type:
java.sql.SQLException: ORA-29877: failed in the execution of the ODCIINDEXUPDATE routine
ORA-13000: dimension number is out of range
ORA-06512: at "MDSYS.SDO_INDEX_METHOD", line 8
ORA-06512: at "MDSYS.SDO_IDX", line 86
ORA-06512: at "MDSYS.SDO_INDEX_METHOD", line 83
ORA-06512: at line 1
I have looked in the Oracle Spatial User Guide for 8i and have not been able to find much on the information above.
Any help from inviduals with more expertise in this area would be great. If I need to provide more information please do indicate this as well
Thanks,
Faroon.

Hi,
The number of dimensions in the object being inserted may be
out of the valid range ( 2 to 4).
Or the diminfo in the user_sdo_geom_metadata for this
layer has been changed the after the index is created.
Check these two places first to make sure the dimensionality
is in the valid range.
The error is raised on index updated when the dimensionality
of the object being updated is not in the valid range.
siva

Similar Messages

  • XML PARASE and insert /update in corresponding tables

    Hi,
    I have a XML in which master details tables 3 tables.I want to separate element and insert/update in corresponding tables dynamically.
    Table invlovled in A,B,C
    Thanks
    Reena

    Reena
    The easiest way to do this is along the following lines..
    (1) register an XML Schema that describes the XML you wish to process with theh database.
    (2). create a relational view for the top level elements and for each repeating element (element where maxOccurs > 1 in the XML Schema)
    (3) Use 'insert as select' or other SQL type processing to update your relational tables from the contents of the view
    It is normally recommended that you add the following annotations to the XML Schema before registering it with the database
    (1) At the schema level set xdb:storeVarrayAsTable="true".
    (2) At the complexType level set xdb:maintainDOM="fasle".
    If you search the forum you will find a lot of examples of creating relational views of XML content stored in the XML database. Typically these examples will include key words like 'create or replace view' and 'table(xmlsequence(extract' or 'xmltable'.
    Hope this helps...
    -Mark

  • Inserts/Updates on replicated tables Logical Standby Database ??

    Hello all,
    We have a Logical standby database on 10.2.0.5. Can you please suggest if there is a way we can do data inserts/updates on replicated tables ?
    Can this be done by doing a alter database guard none; or alter session disable|enable guard; ?? Even if it completes succesfully , will this have any effect on replication later ?

    Hello all,
    We have a Logical standby database on 10.2.0.5. Can you please suggest if there is a way we can do data inserts/updates on replicated tables ?
    Can this be done by doing a alter database guard none; or alter session disable|enable guard; ?? Even if it completes succesfully , will this have any effect on replication later ?

  • Can not insert/update data from table which is created from view

    Hi all
    I'm using Oracle database 11g
    I've created table from view as the following command:
    Create table table_new as select * from View_Old
    I can insert/update data into table_new by command line.
    But I can not Insert/update data of table_new by SI Oject Browser tool or Oracle SQL Developer tool .(read only)
    Anybody tell me, what's happend? cause?
    Thankyou
    thiensu
    Edited by: user8248216 on May 5, 2011 8:54 PM
    Edited by: user8248216 on May 5, 2011 8:55 PM

    I can insert/update data into table_new by command line.
    But I can not Insert/update data of table_new by SI Oject Browser tool or Oracle SQL Developer tool .(read only)so what is wrong with the GUI tools & why posting to DATABASE forum when that works OK?

  • Fetch Insert / Update Query From Table Trigger

    Hi everyone !,
    I have a situation, is there any way where I can get insert/update query by before-insert / after insert trigger when a user inserts/updates any row in the table.
    Plz....help me....champs.....
    Regards,
    Naushad

    That was a nice thing but it works only on some oracle 9i with DML statements.
    On database versions 9.2.0.1 to 9.2.0.6 ora_sql_text works and returns the calling text for dml triggers, where as starting from 9.2.0.7 the behavior has changed and returns NULL.
    Cause
    This issue had surfaced from 9.2.0.7.0 patchset. After discussions in Bug 4171597 which was closed as a duplicate of Bug 4230721 it was concluded that it was the expected behavior i.e ORA_SQL_TXT should return null when dml triggers are used.
    ORA_SQL_TXT is a "System defined event attribute" and is supposed to work only with "System triggers". This is also what the Documentation says - "Application Developers Guide : Fundamentals(9.2)
    Chapter 16 Working with System events".
    Bye Alessandro

  • Using Case statement to insert,update,delete  the tables

    Hi All,
    I have to check the databse ,
    if it is developement then
    insert/update/delete values in tables;
    if it staging then
    insert/update/delete values in tables;
    if it is production then
    insert/update/delete values in tables;
    thers is function available to check the current database
    For doing the about i am trying to write CASE statement like this
    SELECT function,
    case
    when fun = 'developement' then insert into table1 values ('abcd','1234')
    when fun = 'staging' then insert into table1 values ('abcd','1234')
    when fun= 'production' then insert into table1 values ('abcd','1234')
    else null
    from dual
    its throughing me an error
    please help
    Thanks,

    Hi,
    You can use CASE staement any place where an expression is expected.
    For example, in:
    UPDATE  table_a
    SET     col1 = exp1
    ,       col2 = exp2
    WHERE   exp3 = exp4;all the expressions are labled lke expn.
    Note that table_a, col1 and col2 are not expressions: you must hard-code these names, or use dynamic SQL.
    So it's okay to say:
    UPDATE  table_a
    SET     col1 = CASE
                       WHEN  db = 'development'  THEN  0
                       WHEN  db = 'staging'      THEN  1
                   END
    ,       col2 = CASE
                       WHEN  db = 'development'  THEN  NULL
                       WHEN  db = 'staging'      THEN  col2
                   END
    WHERE   db != 'production';In this example:
    in the development database, col1 is set to 0 and col2 is set to NULL
    in the staging database, col1 is set to 1 and col2 is unchanged (that is, set to what it already was)
    in the production database, nothing is changed (the WHERE condition is always FALSE)

  • Interfaces used for insert/update data in tables

    for providing security the procedures are not allowed to directly insert/update the values in tables.some one suggested that use interfaces for this .i want infomation about this interfaces. how this works and how to use

    An interface is an intermediate set of procedures/functions that do the job for you.
    You haven't explained what it is you're trying to achieve exactly, but here's an example scenario.
    We don't want to allow our developers to query, or write to the tables directly so they are set up with certain database users that have no permissions granted on the tables for such things.
    Instead they have been granted permission to call procedures and functions belonging to another schema, and it is those procedures and functions that do the required table access and/or pass information/data back or write to the tables.
    The developers have to write their applications to call these procedures to do any access to the tables. This means that they are limited to the functionality provided by these interface procedures so, if there is internal auditing or columns of data etc. on the tables then it may be that they can't access this data, but only the "user facing" data.
    The interface can also ensure that data meets certain requirements before being written to tables, allowing for business or technical level restrictions to be implemented.

  • Oracle 10g - Insert in to Temporary Table - Record count mismatch between s

    We are trying insert records from a select query in to temporary table, some of the records is missing in the temporary table. The select statement is having multiple joins and union all which it little complex query. In simple terms the script contains 2 part 1st Part Insert in to temporary table 2nd part Select query with multiple joins, inline sub queries, unions and group by classes and conditions
    Eg. If we execute select statement alone it returns some count for example => 60000 After inserting into the temp table, in temp table the count is around 42000 why is the difference?
    It is simple bulk inserts... insert in to temp table select from xxx. also, there is no commit in between. The problem is all the records populated by the select statement are not inserted in to temp table. some records are not inserted.*
    Also, we had some other observation. It only happens in its 2nd execution and not its first run. Hope there might be some cache problem
    Even, we also did not believe that. We are wondering. In TOAD, we tested however at times it happens. In application jar file, after "insert in to temp select * from xxx" we take the i. record count of temp table and ii. record count of "select * from xxx" separately but both doesn't match. Match only at 1st time.
    Thank you in advance for your efforts and help.
    Shiva.

    The code looks like
    sql = "insert in to temptable select x,y,z,.... from xxx,abc,pqr..where...."; (logial but not real is very complex around 700 lines with multiple joins, inline sub queries, group by etc. )
    stmt = conn.createStatement();
    rCount= stmt.executeUpdate(sql);
    Actual issue is
    rCount = xxxx = Count(temptable) < count(select x,y,z,.... from xxx,abc,pqr..where....)
    why this diffference ? some records populated in the select but not inserted in to temp table
    Anyone can explain?

  • Insert & Update while Locking tables

    Update & Insert
    Is it possible for me to insert a record and update 2 fields in another record, whil locking the database tables for the process to take place?
    If so, how?
    Thanks
    Pete

    I don't know which database server you are using. But in MySQL, you can do something like this:
    <?php
    function get_next_number( $field = 'id' )
         $id = 0;
         //Lock the table for write
         mysql_query('LOCK TABLES name_of_table WRITE');
         $sql = 'SELECT '.$field.' FROM name_of_table ORDER BY '.$field.' DESC LIMIT 1';
         $query = mysql_query($sql);
         if ( mysql_num_rows($query) > 0 )
              $row = mysql_fetch_row($query);
              //Get the $field value
              $id = $row[0];
         //Unlock tables
         mysql_query('UNLOCK TABLES');
         return ++$id;
    ?>
    I didn't test this function, but the idea is that
    Check if you are connected to MySQL server
    Regards,
    Rafael

  • Insert / update in same table

    SQL> select * from test;
    TT NAME
    1 hi
    1 re
    1 go
    2 rw
    2 gh
    2 lk
    6 rows selected.
    This is just a dummy table,but I would like to know how can I update the values of TT=2 to make it identical with the values of TT=1
    The table should look like
    SQL> select * from test;
    TT NAME
    1 hi
    1 re
    1 go
    2 hi
    2 re
    2 go
    In reality the records go into lacs

    One way:
    (untested)
    Delete from Test where TT=2;
    Insert into test t1
    select 2, t2.name from test t2 where tt=1;Added where clause, just in case if there are more values for TT.
    Message was edited by:
    Sven W.

  • Oracle 11g: Oracle insert/update operation is taking more time.

    Hello All,
    In Oracle 11g (Windows 2008 32 bit environment) we are facing following issue.
    1) We are inserting/updating data on some tables (4-5 tables and we are firing query with very high rate).
    2) After sometime (say 15 days with same load) we are feeling that the Oracle operation (insert/update) is taking more time.
    Query1: How to find actually oracle is taking more time in insert/updates operation.
    Query2: How to rectify the problem.
    We are having multithread environment.
    Thanks
    With Regards
    Hemant.

    Liron Amitzi wrote:
    Hi Nicolas,
    Just a short explanation:
    If you have a table with 1 column (let's say a number). The table is empty and you have an index on the column.
    When you insert a row, the value of the column will be inserted to the index. To insert 1 value to an index with 10 values in it will be fast. It will take longer to insert 1 value to an index with 1 million values in it.
    My second example was if I take the same table and let's say I insert 10 rows and delete the previous 10 from the table. I always have 10 rows in the table so the index should be small. But this is not correct. If I insert values 1-10 and then delete 1-10 and insert 11-20, then delete 11-20 and insert 21-30 and so on, because the index is sorted, where 1-10 were stored I'll now have empty spots. Oracle will not fill them up. So the index will become larger and larger as I insert more rows (even though I delete the old ones).
    The solution here is simply revuild the index once in a while.
    Hope it is clear.
    Liron Amitzi
    Senior DBA consultant
    [www.dbsnaps.com]
    [www.orbiumsoftware.com]Hmmm, index space not reused ? Index rebuild once a while ? That was what I understood from your previous post, but nothing is less sure.
    This is a misconception of how indexes are working.
    I would suggest the reading of the following interasting doc, they are a lot of nice examples (including index space reuse) to understand, and in conclusion :
    http://richardfoote.files.wordpress.com/2007/12/index-internals-rebuilding-the-truth.pdf
    "+Index Rebuild Summary+
    +•*The vast majority of indexes do not require rebuilding*+
    +•Oracle B-tree indexes can become “unbalanced” and need to be rebuilt is a myth+
    +•*Deleted space in an index is “deadwood” and over time requires the index to be rebuilt is a myth*+
    +•If an index reaches “x” number of levels, it becomes inefficient and requires the index to be rebuilt is a myth+
    +•If an index has a poor clustering factor, the index needs to be rebuilt is a myth+
    +•To improve performance, indexes need to be regularly rebuilt is a myth+"
    Good reading,
    Nicolas.

  • SQL SERVER BULK FETCH AND INSERT/UPDATE?

    Hi All,
           I am currently working with C and SQL Server 2012. My requirement is to Bulk fetch the records and Insert/Update the same in the other table with some  business logic?
           How do i do this?
           Thanks in Advance.
    Regards
    Yogesh.B

    > is there a possibility that I can do a bulk fetch and place it in an array, even inside a stored procedure ?
    You can use Temporary tables or Table variables and have them indexes as well
    >After I have processed my records, tell me a way that I will NOT go, RECORD by RECORD basis, even inside a stored procedure ?
    As i said earlier, you can perform UPDATE these temporary tables or table variables and finally INSERT/ UPDATE your base table
    >Arrays are used just to minimize the traffic between the server and the program area. They are used for efficient processing.
    In your case you will first have to populate the array (Using some of your queries from the server) which means you will first load the arrary, do some updates, and then send them back to server therefore
    network engagement
    So I just gave you some thoughts I feel could be useful for your implementation, like we say, there are many ways so pick the one that works good for you in the long run with good scalability
    Good Luck! Please Mark This As Answer if it solved your issue. Please Vote This As Helpful if it helps to solve your issue

  • How to update two database tables when using DatabaseProvider

    I'm a begginer and I've made an application which uses a database. In one page, I have a table which I've took it from "woodstock basic" palette. I was using DatabaseProvider to populate the table with data from a database table called "copii". My code is:
    //i'm check all the rows in the table to see if the field "IDCOPIIC" =0 and if true I will put the value of "newCopiiId"
    do {
    if (copiiDataProvider.getValue("IDCOPIIC").equals
    (new Long(0))) {
    copiiDataProvider.setValue("IDCOPIIC", new Long(newCopiiId));
    newCopiiId++;
    } while (copiiDataProvider.cursorNext());
    copiiDataProvider.commitChanges();
    My problem comes now because I have another database table tided with a foreign key by this one and I want to update this one too when I'm updating the "copii" table. I don't know how to do it ...I've tried in many ways but is impossible. Can anyone help me ! I'm desperate...I cannot figure it out how I could insert, update in two tables in the same time when I'm using DataProvider .
    Thanks in advance!

    Hmm.
    Not sure where your going with the <select> menu.
    The description you made:
    "Both have an id column, which is presumably the record's primary key, but you need to create a relationship by storing the primary key of one table as a foreign key in the child (related) table. For example, you should insert the primary key of the first table in the second table as user_id. That enables you to identify which username and password are related to an individual listed in the second table"
    Seems to be the direction that I'm looking for.
    Now my question is how do I insert the primary key of the first table in the second table as user_id?
    >
    >"For example, you should insert the primary key of the first table in the second table as user_id"
    Since both tables have an id column and they both are the primary key, do I just change the name of the second tables id column to "user_id" then?
    Or is there an actual "insert the primary key to another table" function that I don't know about?

  • Insert / update data to a table through DBLINK (oracle)

    I try to insert / update a table from one instance of oracle database to another one through oracle dblink, get following error:
    java.sql.SQLException: ORA-01008: not all variables bound
    ORA-02063: preceding line from MYLINK
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
    at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
    at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:582)
    at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1986)
    at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1144)
    at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2152)
    at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:2035)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2876)
    at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:609)
    The same code to insert / update the exact same table in local instance works fine.No any binding problem. So i am pretty sure all ? mark in SQL are set with some value before sending to Oracle.
    Someone please advise what is possible problem. Db link is not set correctly? or we can not update remote table by dblink.
    By the way i can do insert / update from TOAD to the remote table through DBLINK. Problem happens only in Java code.
    thanks!
    Gary

    dblink links from one database instance to another.
    So it is certainly a source of possible problems when it works on one database and not another.
    You should start by looking at the dblink and it possible testing it in the database not via java.
    Note as well that that error suggests that it is coming from the Oracle database. I believe if you had a bind parameter problem in your java code that the error would come from the driver. But that is a guess on my part.

  • Oracle spatial 11g - 3D-Geometry and KML-Export

    Hi,
    I'm currently working with an Oracle Spatial 11g - database and there with 2d- and 3d-geometries. With this Version you can extrude 2d's to 3d's and calculate their volumes. This works fine.
    The problem is to save the extruded areas as 3d-geometries in a specific table. Enclosed you will find the SQL-Code of the current workflow:
    *1. Create tables for the 2d- and 3d-geometries (incl. metadata and spatial index)*
    -- table for 3d-geometry
    CREATE
    TABLE ta_geb(
    geom MDSYS.SDO_GEOMETRY
    ,area NUMBER(12,3)
    -- metadata 2D
    INSERT INTO USER_SDO_GEOM_METADATA (TABLE_NAME, COLUMN_NAME, DIMINFO, SRID)
    VALUES
         'ta_geb',
         'geom',
    MDSYS.SDO_DIM_ARRAY
    (MDSYS.SDO_DIM_ELEMENT('X',4439900.00, 4440020.00, 0.005),
    MDSYS.SDO_DIM_ELEMENT('Y', 5664050.00, 5664130.00, 0.005)
    31468
    -- spatial index 2D
    CREATE
    INDEX ta_geb_index ON ta_geb(geom) INDEXTYPE IS MDSYS.SPATIAL_INDEX;
    -- table for 3d-geometry
    CREATE
    TABLE ta_3dgeb(
    geom3d MDSYS.SDO_GEOMETRY
    -- metadata 3D
    INSERT INTO USER_SDO_GEOM_METADATA (TABLE_NAME, COLUMN_NAME, DIMINFO, SRID)
    VALUES
         'ta_3dgeb',
         'geom3d',
    MDSYS.SDO_DIM_ARRAY
    (     MDSYS.SDO_DIM_ELEMENT('X',4439900.00, 4440020.00, 0.005),
         MDSYS.SDO_DIM_ELEMENT('Y', 5664050.00, 5664130.00, 0.005),
         MDSYS.SDO_DIM_ELEMENT('Z', 0, 200, 0.005)
    31468
    -- spatial index
    CREATE
    INDEX ta_3dgeb_index ON ta_3dgeb(geom3d) INDEXTYPE IS MDSYS.SPATIAL_INDEX PARAMETERS ('SDO_INDX_DIMS=3');
    *2. insert 2d-geomtry*
    INSERT
    INTO
    ta_geb
    VALUES
    MDSYS.SDO_GEOMETRY(
    2003
    ,31468
    ,NULL
    ,MDSYS.SDO_ELEM_INFO_ARRAY(
    1
    ,1003
    ,1
    ,MDSYS.SDO_ORDINATE_ARRAY(
         4439975.91,5664077.07,
              4439967.98,5664072.06,
              4439975.33,5664060.42,
              4439983.26,5664065.43,
              4439975.91,5664077.07
    ,null --area
    *3. calculate volume of the extruded area*
    SELECT SDO_GEOM.SDO_VOLUME(SDO_UTIL.EXTRUDE(
         GEOM,
         SDO_NUMBER_ARRAY(0),
         SDO_NUMBER_ARRAY(10),
         'false', --validation
         0.005),0.005)
    from ta_geb;
    This works fine so far. Now I wanna insert the extruded geometry (now 3D) in the table ta_3dgeb. All my attempts were in vain...
    *4. insert extruded geomtry*
    INSERT
    INTO
    ta_3dgeb
    select
    SDO_UTIL.EXTRUDE(
              GEOM,
              SDO_NUMBER_ARRAY(0),
              SDO_NUMBER_ARRAY(10),
              'false', --validation
              0.005)
    from ta_geb;
    I got the following error message after executing this Code:
    ORA-29875: failed in the execution of the ODCIINDEXINSERT routine
    ORA-13365: layer SRID does not match geometry SRID
    ORA-06512: in "MDSYS.SDO_INDEX_METHOD_10I", line 709
    ORA-06512: in "MDSYS.SDO_INDEX_METHOD_10I", line 225
    Then I tried to change something on the metadata and spatial indices, wihtout success. Does anyone has advices to solve the problem??
    Afterwards I would like to export the 3d-geometry in a KML file to visualize it in Google Earth. Therefore oracle provides a tool. But I didn't managed it to export the geometry. Any hints for the KML export or are there any other tools alternatively??
    Thanks for any suggestions!
    Regards

    Extrude does not automatically populate the SRID for the resulting geometry as there may not be a 3D equivalent of the 2D SRID defined
    in the DB.
    So the extruded geometry comes out without the SRID. In your case, since you are creating an index on the ta_3dgeb table
    before inserting the extruded data, it is causing this failure.
    So drop the index on the ta_3dgeb table and do the inserts into it.
    Then you can manually update the geometries with the SRID if there is a corresponding 3D SRID for 31468.
    Otherwise, you can use 31468.
    siva

Maybe you are looking for