GROUP BY on a table with geometry

Good evening
This is an overview of my table
Geometry_|_ID_GEO_|_Year_|_Value
Polygon1_|__1______|_1999_|__5
Polygon1_|__1______|_1999_|__7
Polygon2_|__2______|_1999_|__4
Polygon2_|__2______|_1999_|__12
I would like to group this table by geometry and by year suming the value to obtain something like that:
Geometry_|_ID_GEO_|_Year_|_Value
Polygon1_|__1______|_1999_|__12
Polygon2_|__2______|_1999_|__16
I have written the following SQL statement which work perfectly:
SELECT SUM(Value),ID_GEO FROM MyTable WHERE Year=1999 GROUP BY ID_GEO
But when i add the Geometry field in the statement like:
SELECT Geometry,SUM(Value),ID_GEO FROM MyTable WHERE Year=1999 GROUP BY ID_GEO
It does not work anymore. I obtain an error: SQLState: 42000, ErrorCode: 979 which seems to be related to the Group by...
The point is that i need the Geometry in the result query to then generate a map.
I am using Oracle entreprise 10 with oracle Locator only.
Can anyone help me? I don't understand why it does not work.
Many thanks
Sylvain

I was faced with a similar issue more than a year ago. The solution for me was to create an user defined aggregate function: agg_first_geom. This will help aggragating your data by keeping/taking the first geometry. This of course is valid when you have a 1 to 1 relationship with one of the columns in your group by, which you confirmed earlier.
Try it and see whether this could be of help.
first create the type agg_geom_t and the function agg_first_geom. Once that is finished you should be able to have your SQL statement as follows:
SELECT SUM(Value) as SUMOfValue ,ID_GEO, agg_first_geom(geometry) FROM MyTable WHERE Year=1999 GROUP BY ID_GEO
create or replace type agg_geom_t as object (
    geom_agg mdsys.sdo_geometry,
    static function ODCIAggregateInitialize(sctx in out agg_geom_t)
        return number,
    member function ODCIAggregateIterate(self in out agg_geom_t,
        value in mdsys.sdo_geometry) return number,
    member function ODCIAggregateTerminate(self in agg_geom_t,
        return_value out mdsys.sdo_geometry, flags in number) return number,
    member function ODCIAggregateMerge(self in out agg_geom_t,
        ctx2 in agg_geom_t) return number
create or replace type body agg_geom_t is
    static function ODCIAggregateInitialize(sctx in out agg_geom_t)
        return number is
    begin
        sctx := agg_geom_t(null);
        return ODCIConst.Success;
    end;
    member function ODCIAggregateIterate(
      self in out agg_geom_t, value in mdsys.sdo_geometry)
        return number is
    begin
        geom_agg := value;
        return ODCIConst.Success;
    end;
    member function ODCIAggregateTerminate(self in agg_geom_t,
        return_value out mdsys.sdo_geometry, flags in number) return number is
    begin
        return_value := geom_agg;
        return ODCIConst.Success;
    end;
    member function ODCIAggregateMerge(self in out agg_geom_t,
        ctx2 in agg_geom_t) return number is
    begin
     geom_agg := ctx2.geom_agg;
        return ODCIConst.Success;
    end;
end;
create or replace function agg_first_geom (input mdsys.sdo_geometry) return mdsys.sdo_geometry
    parallel_enable aggregate using agg_geom_t;
commit;SELECT SUM(Value) as SUMOfValue ,ID_GEO, agg_first_geom(geometry) FROM MyTable WHERE Year=1999 GROUP BY ID_GEO

Similar Messages

  • 29875; error updating table with geometry but without index

    hi,
    I've a table with next description
    AGGREGATEDUNIT_ID NOT NULL NUMBER(38)
    DATASET_ID NUMBER(38)
    GEOMETRY MDSYS.SDO_GEOMETRY
    REDEFINEDMETADATA SYS.XMLTYPE
    I dont need a spatial index in column GEOMETRY, but when I try an update operation:
    INSERT INTO AGGREGATEDUNIT (AGGREGATEDUNIT_ID, DATASET_ID) VALUES (389, 893)
    I get next error:
    INSERT INTO AGGREGATEDUNIT
    ERROR en lmnea 1:
    ORA-29875: fallo al ejecutar la rutina ODCIINDEXINSERT
    ORA-13203: fallo al leer la tabla USER_SDO_GEOM_METADATA
    ORA-13203: fallo al leer la tabla USER_SDO_GEOM_METADATA
    ORA-06512: en "MDSYS.SDO_INDEX_METHOD_9I", lmnea 183
    ORA-06512: en lmnea 1
    anybody knows?
    thanx

    Hi,
    Whether you need the index or not, someone has created a spatial index on the table.
    You can drop the index, or you can add the metadata for the table into user_sdo_geom_metadata (it was there at the time the index was created).
    Hope this helps,
    Dan

  • Indexes for group by query on table with 5million records

    Hi,
    Here is my query which is taking ages to run :
         SELECT approved.budgetReferenceno
                   , approved.projects
                   , approved.allocations
                   , rptgen4
                         , financialyear
                   , cashclass
                   , SUM(nvl(approved.FullYear,0)) as FullYear
              FROM   approved
              JOIN   rpt_entity ON rpt_entity.level0 = approved.entity
              JOIN   cashclasses     ON accountcode    = approved.account
        where budgetreferenceno = refno    
        and
            entity in ( 
               (select Level0 from rpt_entity   where   
               (   entityparent in (select * from table(split(userid)))    or   rptgen5 in (select * from table(split(userid)))   )   ) 
         and
           ccs in (select level0 from rpt_ccs where rptgen4 in (select * from table(split(userid)))) or
           ccs in (select level0 from rpt_ccs where rptgen5 in (select * from table(split(userid)))) or
           ccs in (select level0 from rpt_ccs where rptgen6 in (select * from table(split(userid)))) or
           ccs in (select level0 from rpt_ccs where rptgen7 in (select * from table(split(userid))) ) or
           ccs in (select distinct(substr(column_value,2,length(column_value)-2)) from table(split_comma(userid)) )
              GROUP BY approved.budgetReferenceno
                   , approved.projects
                   , approved.allocations
                   , rptgen4
                         , financialyear
                   , cashclass
    SQL> select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    Plan hash value: 4074481161
    | Id  | Operation                                | Name            | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT                         |                 | 31234 |  3660K|       | 86141   (1)| 00:17:14 |
    |   1 |  HASH GROUP BY                           |                 | 31234 |  3660K|    17M| 86141   (1)| 00:17:14 |
    |*  2 |   FILTER                                 |                 |       |       |       |            |          |
    |*  3 |    HASH JOIN                             |                 |   138K|    15M|       | 82427   (1)| 00:16:30 |
    |   4 |     TABLE ACCESS FULL                    | CASHCLASSES     |  2875 | 48875 |       |     5   (0)| 00:00:01 |
    |*  5 |     HASH JOIN                            |                 |   138K|    13M|       | 82420   (1)| 00:16:30 |
    PLAN_TABLE_OUTPUT
    |   6 |      TABLE ACCESS FULL                   | RPT_entity  |   725 | 10875 |       |    11   (0)| 00:00:01 |
    |*  7 |      HASH JOIN RIGHT SEMI                |                 |   138K|    11M|       | 82408   (1)| 00:16:29 |
    |   8 |       VIEW                               | VW_NSO_1        |    71 |   568 |       |    11   (0)| 00:00:01 |
    |*  9 |        FILTER                            |                 |       |       |       |            |          |
    |  10 |         TABLE ACCESS FULL                | RPT_entity  |   725 | 17400 |       |    11   (0)| 00:00:01 |
    |* 11 |         COLLECTION ITERATOR PICKLER FETCH| SPLIT           |       |       |       |            |          |
    |* 12 |         COLLECTION ITERATOR PICKLER FETCH| SPLIT           |       |       |       |            |          |
    |* 13 |       TABLE ACCESS FULL                  | approved        |  1170K|    89M|       | 82389   (1)| 00:16:29 |
    |  14 |    NESTED LOOPS                          |                 |     1 |    18 |       |    46   (0)| 00:00:01 |
    |  15 |     COLLECTION ITERATOR PICKLER FETCH    | SPLIT           |       |       |       |            |          |
    |* 16 |     INDEX RANGE SCAN                     | CC_INDEX1       |     1 |    16 |       |     1   (0)| 00:00:01 |
    PLAN_TABLE_OUTPUT
    |  17 |    NESTED LOOPS                          |                 |     2 |    46 |       |    51   (2)| 00:00:01 |
    |* 18 |     INDEX FAST FULL SCAN                 | CC_INDEX2       |     1 |    21 |       |    46   (3)| 00:00:01 |
    |* 19 |     COLLECTION ITERATOR PICKLER FETCH    | SPLIT           |       |       |       |            |          |
    |  20 |    NESTED LOOPS                          |                 |     1 |    24 |       |    52   (0)| 00:00:01 |
    |  21 |     TABLE ACCESS BY INDEX ROWID          | RPT_ccs |     1 |    22 |       |    46   (0)| 00:00:01 |
    |* 22 |      INDEX SKIP SCAN                     | CC_INDEX1       |     1 |       |       |    45   (0)| 00:00:01 |
    |* 23 |     COLLECTION ITERATOR PICKLER FETCH    | SPLIT           |       |       |       |            |          |
    |  24 |    NESTED LOOPS                          |                 |     2 |    50 |       |    60   (0)| 00:00:01 |
    |  25 |     TABLE ACCESS BY INDEX ROWID          | RPT_ccs |     1 |    23 |       |    46   (0)| 00:00:01 |
    |* 26 |      INDEX SKIP SCAN                     | CC_INDEX1       |     1 |       |       |    45   (0)| 00:00:01 |
    |* 27 |     COLLECTION ITERATOR PICKLER FETCH    | SPLIT           |       |       |       |            |          |
    PLAN_TABLE_OUTPUT
    |* 28 |    COLLECTION ITERATOR PICKLER FETCH     | SPLIT_COMMA     |       |       |       |            |          |
    Predicate Information (identified by operation id):
       2 - filter( EXISTS (SELECT 0 FROM "RPT_ccs" "RPT_ccs",TABLE() "KOKBF$" WHERE
                  "LEVEL0"=:B1 AND "RPTGEN4"=VALUE(KOKBF$)) OR  EXISTS (SELECT 0 FROM "RPT_ccs"
                  "RPT_ccs",TABLE() "KOKBF$" WHERE "RPTGEN5"=VALUE(KOKBF$) AND "LEVEL0"=:B2) OR  EXISTS (SELECT 0
                  FROM "RPT_ccs" "RPT_ccs",TABLE() "KOKBF$" WHERE "RPTGEN6"=VALUE(KOKBF$) AND "LEVEL0"=:B3)
                  OR  EXISTS (SELECT 0 FROM "RPT_ccs" "RPT_ccs",TABLE() "KOKBF$" WHERE
    PLAN_TABLE_OUTPUT
                  "RPTGEN7"=VALUE(KOKBF$) AND "LEVEL0"=:B4) OR  EXISTS (SELECT 0 FROM TABLE() "KOKBF$" WHERE
                  SUBSTR(VALUE(KOKBF$),2,LENGTH(VALUE(KOKBF$))-2)=:B5))
       3 - access("ACCOUNTCODE"="approved"."ACCOUNT")
       5 - access("RPT_entity"."LEVEL0"="approved"."entity")
       7 - access("approved"."entity"="LEVEL0")
       9 - filter( EXISTS (SELECT 0 FROM TABLE() "KOKBF$" WHERE VALUE(KOKBF$)=:B1) OR  EXISTS (SELECT 0 FROM
                  TABLE() "KOKBF$" WHERE VALUE(KOKBF$)=:B2))
      11 - filter(VALUE(KOKBF$)=:B1)
      12 - filter(VALUE(KOKBF$)=:B1)
      13 - filter("approved"."BUDGETREFERENCENO"='BASE')
      16 - access("RPTGEN4"=VALUE(KOKBF$) AND "LEVEL0"=:B1)
    PLAN_TABLE_OUTPUT
      18 - filter("LEVEL0"=:B1)
      19 - filter("RPTGEN5"=VALUE(KOKBF$))
      22 - access("LEVEL0"=:B1)
           filter("LEVEL0"=:B1)
      23 - filter("RPTGEN6"=VALUE(KOKBF$))
      26 - access("LEVEL0"=:B1)
           filter("LEVEL0"=:B1)
      27 - filter("RPTGEN7"=VALUE(KOKBF$))
      28 - filter(SUBSTR(VALUE(KOKBF$),2,LENGTH(VALUE(KOKBF$))-2)=:B1)
    64 rows selected.
    SQL> select * from v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
    PL/SQL Release 11.1.0.7.0 - Production
    CORE    11.1.0.7.0      Production
    TNS for IBM/AIX RISC System/6000: Version 11.1.0.7.0 - Production
    NLSRTL Version 11.1.0.7.0 - ProductionThe table has 28 columns none indexed the columns mentioned here have non unique values.
    The table approved has more than 10million records and the query is taking a huge time.
    The query first tries to restrict the search to only valid entities and cc (already indexed and working fine).
    The cardinality of allocations, projects is around 1000, entity is 3000, and cc is around 50,000, reference number = 2000, financialyear = 4
    Please suggest which index would be best to use on these columns given that there will no updations but frequent insertions.
    If nothing else works than I will need to change it to pre aggregated data for overnight run .
    Thanks,
    Neetesh
    Edited by: user13312817 on Nov 16, 2011 11:05 AM
    Edited by: user13312817 on Nov 16, 2011 11:36 AM
    Edited by: user13312817 on Nov 16, 2011 11:38 AM
    Edited by: user13312817 on Nov 16, 2011 12:02 PM

    Hello Adam,
    Tried this but still not much of a difference.
    create index test_index on approved (budgetreferenceno,projects,allocations,financialyear,entity,ccs,FullYear) compress 6;
    SQL> select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    Plan hash value: 2463060356
    | Id  | Operation                               | Name            | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT                        |                 | 25030 |  4644K|       | 70852   (1)| 00:14:11 |
    |   1 |  TABLE ACCESS BY INDEX ROWID            | FEGEN4          |     1 |    13 |       |     2   (0)| 00:00:01 |
    |*  2 |   INDEX UNIQUE SCAN                     | INDEX1          |     1 |       |       |     1   (0)| 00:00:01 |
    |   3 |  TABLE ACCESS BY INDEX ROWID            | CASHCLASSES     |     1 |    17 |       |     2   (0)| 00:00:01 |
    |*  4 |   INDEX UNIQUE SCAN                     | CASHCLASSES_PK  |     1 |       |       |     1   (0)| 00:00:01 |
    |   5 |  HASH GROUP BY                          |                 | 25030 |  4644K|    21M| 70852   (1)| 00:14:11 |
    PLAN_TABLE_OUTPUT
    |   6 |   VIEW                                  |                 |   109K|    19M|       | 68578   (1)| 00:13:43 |
    |*  7 |    FILTER                               |                 |       |       |       |            |          |
    |*  8 |     HASH JOIN RIGHT SEMI                |                 |   484K|    99M|       | 68578   (1)| 00:13:43 |
    |   9 |      VIEW                               | VW_NSO_1        |    71 |  7242 |       |    11   (0)| 00:00:01 |
    |* 10 |       FILTER                            |                 |       |       |       |            |          |
    |  11 |        TABLE ACCESS FULL                | RPT_entity  |   725 | 17400 |       |    11   (0)| 00:00:01 |
    |* 12 |        COLLECTION ITERATOR PICKLER FETCH| SPLIT           |       |       |       |            |          |
    |* 13 |        COLLECTION ITERATOR PICKLER FETCH| SPLIT           |       |       |       |            |          |
    |* 14 |      TABLE ACCESS FULL                  | approved         |   982K|   106M|       | 68560   (1)| 00:13:43 |
    |  15 |     NESTED LOOPS                        |                 |     1 |    18 |       |    46   (0)| 00:00:01 |
    |  16 |      COLLECTION ITERATOR PICKLER FETCH  | SPLIT           |       |       |       |            |          |
    PLAN_TABLE_OUTPUT
    |* 17 |      INDEX RANGE SCAN                   | CC_INDEX1       |     1 |    16 |       |     1   (0)| 00:00:01 |
    |  18 |     NESTED LOOPS                        |                 |     2 |    46 |       |    51   (2)| 00:00:01 |
    |* 19 |      INDEX FAST FULL SCAN               | CC_INDEX2       |     1 |    21 |       |    46   (3)| 00:00:01 |
    |* 20 |      COLLECTION ITERATOR PICKLER FETCH  | SPLIT           |       |       |       |            |          |
    |  21 |     NESTED LOOPS                        |                 |     1 |    24 |       |    52   (0)| 00:00:01 |
    |  22 |      TABLE ACCESS BY INDEX ROWID        | RPT_ccs |     1 |    22 |       |    46   (0)| 00:00:01 |
    |* 23 |       INDEX SKIP SCAN                   | CC_INDEX1       |     1 |       |       |    45   (0)| 00:00:01 |
    |* 24 |      COLLECTION ITERATOR PICKLER FETCH  | SPLIT           |       |       |       |            |          |
    |  25 |     NESTED LOOPS                        |                 |     2 |    50 |       |    60   (0)| 00:00:01 |
    |  26 |      TABLE ACCESS BY INDEX ROWID        | RPT_ccs |     1 |    23 |       |    46   (0)| 00:00:01 |
    |* 27 |       INDEX SKIP SCAN                   | CC_INDEX1       |     1 |       |       |    45   (0)| 00:00:01 |
    PLAN_TABLE_OUTPUT
    |* 28 |      COLLECTION ITERATOR PICKLER FETCH  | SPLIT           |       |       |       |            |          |
    |* 29 |     COLLECTION ITERATOR PICKLER FETCH   | SPLIT_COMMA     |       |       |       |            |          |
    Predicate Information (identified by operation id):
       2 - access("LEVEL0"=:B1)
       4 - access("ACCOUNTCODE"=:B1)
       7 - filter( EXISTS (SELECT 0 FROM "RPT_ccs" "RPT_ccs",TABLE() "KOKBF$" WHERE
                  "LEVEL0"=:B1 AND "RPTGEN4"=VALUE(KOKBF$)) OR  EXISTS (SELECT 0 FROM "RPT_ccs"
    PLAN_TABLE_OUTPUT
                  "RPT_ccs",TABLE() "KOKBF$" WHERE "RPTGEN5"=VALUE(KOKBF$) AND "LEVEL0"=:B2) OR  EXISTS (SELECT 0
                  FROM "RPT_ccs" "RPT_ccs",TABLE() "KOKBF$" WHERE "RPTGEN6"=VALUE(KOKBF$) AND "LEVEL0"=:B3)
                  OR  EXISTS (SELECT 0 FROM "RPT_ccs" "RPT_ccs",TABLE() "KOKBF$" WHERE
                  "RPTGEN7"=VALUE(KOKBF$) AND "LEVEL0"=:B4) OR  EXISTS (SELECT 0 FROM TABLE() "KOKBF$" WHERE
                  SUBSTR(VALUE(KOKBF$),2,LENGTH(VALUE(KOKBF$))-2)=:B5))
       8 - access("entity"="LEVEL0")
      10 - filter( EXISTS (SELECT 0 FROM TABLE() "KOKBF$" WHERE VALUE(KOKBF$)=:B1) OR  EXISTS (SELECT 0 FROM
                  TABLE() "KOKBF$" WHERE VALUE(KOKBF$)=:B2))
      12 - filter(VALUE(KOKBF$)=:B1)
      13 - filter(VALUE(KOKBF$)=:B1)
      14 - filter("BUDGETREFERENCENO"='BASE')
    PLAN_TABLE_OUTPUT
      17 - access("RPTGEN4"=VALUE(KOKBF$) AND "LEVEL0"=:B1)
      19 - filter("LEVEL0"=:B1)
      20 - filter("RPTGEN5"=VALUE(KOKBF$))
      23 - access("LEVEL0"=:B1)
           filter("LEVEL0"=:B1)
      24 - filter("RPTGEN6"=VALUE(KOKBF$))
      27 - access("LEVEL0"=:B1)
           filter("LEVEL0"=:B1)
      28 - filter("RPTGEN7"=VALUE(KOKBF$))
      29 - filter(SUBSTR(VALUE(KOKBF$),2,LENGTH(VALUE(KOKBF$))-2)=:B1)
    PLAN_TABLE_OUTPUT
    Note
       - dynamic sampling used for this statement
    69 rows selected.Thanks,
    Neetesh
    Edited by: user13312817 on Nov 17, 2011 7:04 AM

  • Error while running spatial queries on a table with more than one geometry.

    Hello,
    I'm using GeoServer with Oracle Spatial database, and this is a second time I run into some problems because we use tables with more than one geometry.
    When GeoServer renders objects with more than one geometry on the map, it creates a query where it asks for objects which one of the two geometries interacts with the query window. This type of query always fails with "End of TNS data channel" error.
    We are running Oracle Standard 11.1.0.7.0.
    Here is a small script to demonstrate the error. Could anyone confirm that they also have this type of error? Or suggest a fix?
    What this script does:
    1. Create table object1 with two geometry columns, geom1, geom2.
    2. Create metadata (projected coordinate system).
    3. Insert a row.
    4. Create spacial indices on both columns.
    5. Run a SDO_RELATE query on one column. Everything is fine.
    6. Run a SDO_RELATE query on both columns. ERROR: "End of TNS data channel"
    7. Clean.
    CREATE TABLE object1
    id NUMBER PRIMARY KEY,
    geom1 SDO_GEOMETRY,
    geom2 SDO_GEOMETRY
    INSERT INTO user_sdo_geom_metadata (table_name, column_name, srid, diminfo)
    VALUES
    'OBJECT1',
    'GEOM1',
    2180,
    SDO_DIM_ARRAY
    SDO_DIM_ELEMENT('X', 400000, 700000, 0.05),
    SDO_DIM_ELEMENT('Y', 300000, 600000, 0.05)
    INSERT INTO user_sdo_geom_metadata (table_name, column_name, srid, diminfo)
    VALUES
    'OBJECT1',
    'GEOM2',
    2180,
    SDO_DIM_ARRAY
    SDO_DIM_ELEMENT('X', 400000, 700000, 0.05),
    SDO_DIM_ELEMENT('Y', 300000, 600000, 0.05)
    INSERT INTO object1 VALUES(1, SDO_GEOMETRY(2001, 2180, SDO_POINT_TYPE(500000, 400000, NULL), NULL, NULL), SDO_GEOMETRY(2001, 2180, SDO_POINT_TYPE(550000, 450000, NULL), NULL, NULL));
    CREATE INDEX object1_geom1_sidx ON object1(geom1) INDEXTYPE IS MDSYS.SPATIAL_INDEX;
    CREATE INDEX object1_geom2_sidx ON object1(geom2) INDEXTYPE IS MDSYS.SPATIAL_INDEX;
    SELECT *
    FROM object1
    WHERE
    SDO_RELATE("GEOM1", SDO_GEOMETRY(2001, 2180, SDO_POINT_TYPE(500000, 400000, NULL), NULL, NULL), 'MASK=ANYINTERACT') = 'TRUE';
    SELECT *
    FROM object1
    WHERE
    SDO_RELATE("GEOM1", SDO_GEOMETRY(2001, 2180, SDO_POINT_TYPE(500000, 400000, NULL), NULL, NULL), 'MASK=ANYINTERACT') = 'TRUE' OR
    SDO_RELATE("GEOM2", SDO_GEOMETRY(2001, 2180, SDO_POINT_TYPE(500000, 400000, NULL), NULL, NULL), 'MASK=ANYINTERACT') = 'TRUE';
    DELETE FROM user_sdo_geom_metadata WHERE table_name = 'OBJECT1';
    DROP INDEX object1_geom1_sidx;
    DROP INDEX object1_geom2_sidx;
    DROP TABLE object1;
    Thanks for help.

    This error appears in GeoServer and SQLPLUS.
    I have set up a completly new database installation to test this error and everything works fine. I tried it again on the previous database but I still get the same error. I also tried to restart the database, but with no luck, the error is still there. I geuss something is wrong with the database installation.
    Anyone knows what could cause an error like this "End of TNS data channel"?

  • Spatial index creation for table with more than one geometry columns?

    I have table with more than one geometry columns.
    I'v added in user_sdo_geom_metadata table record for every column in the table.
    When I try to create spatial indexes over geometry columns in the table - i get error message:
    ERROR at line 1:
    ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
    ORA-13203: failed to read USER_SDO_GEOM_METADATA table
    ORA-13203: failed to read USER_SDO_GEOM_METADATA table
    ORA-06512: at "MDSYS.SDO_INDEX_METHOD", line 8
    ORA-06512: at line 1
    What is the the solution?

    I'v got errors in my user_sdo_geom_metadata.
    The problem does not exists!

  • Diff Between Internal Table with Occurs 0 & Field Groups

    Hi,
    Is there really any difference between just using an internal table with an OCCURS 0 statement-- which would write the entire table to paging space-- and using field-groups? How is Field-Groups is more effective than Internal tables with occurs 0 when it comes to performance?
    Could anybody please give some information regarding above question?
    Thanks,
    Mohan.

    hi,
    occurs 0 means it wont create any extra memory. based on the records only the memory is allocated to internal tables at run time. but when an internal table is created it can hold data of type to which it is declared.
    i.e data: itab like mara occurs 0 with header line.
    can take data only from mara table
    we can also do in another way as using types keyword we can declare a standard structure and create a internal table of that type. its also not that useful as we have to change the structure depending on changes for storing data.
    for this purpose field symbols are used. field symbols can hold any data means that they can point to tables, fields, any standard or user-defined types. field symbols actually points to respective types by which we can directly access to that types using field symbols.
    filed symbols works more faster than internal tables.
    if helpful reward some points.
    with regards,
    Suresh.A

  • Differences between Internal table with Occurs 0 and Field-Groups?

    Is there really any difference between just using an internal table with an OCCURS 0 statement-- which would write the entire table to paging space-- and using field-groups? How is Field-Groups is more effective than Internal tables with occurs 0 when it comes to performance?
    Could anybody please give some information regarding above question?
    Thanks,
    Surya.

    hi,
    occurs 0 means it wont create any extra memory. based on the records only the memory is allocated to internal tables at run time. but when an internal table is created it can hold data of type to which it is declared.
    i.e data: itab like mara occurs 0 with header line.
    can take data only from mara table
    we can also do in another way as using types keyword we can declare a standard structure and create a internal table of that type. its also not that useful as we have to change the structure depending on changes for storing data.
    for this purpose field symbols are used. field symbols can hold any data means that they can point to tables, fields, any standard or user-defined types. field symbols actually points to respective types by which we can directly access to that types using field symbols.
    filed symbols works more faster than internal tables.
    if helpful reward some points.
    with regards,
    Suresh.A

  • Fixed length outer table with nested repeating group inner table.

    I had to re-create a PDF using tables in an RTF template. It has a fixed 1 page width. However, one of the rows in the template has a nested table with a repeating group. I set the width of the outer table row width to 2". However when I have repeating groups it makes the outer row grow wider than the 2" inches. The option to un-select "automatically resize to fit contents" is grayed out.
    Is there a way to keep the outer table width fixed with an inner repeating group?
    Thanks.
    --Johnnie
    Edited by: Vortex13 on Jun 13, 2012 11:15 AM

    Hi Borris,
    Found the following in the Oracle Documentation under: Oracle8i Application Developer's Guide - Object-Relational Features Release 2 (8.1.6)
    2 Managing Oracle Objects / Using Collections / Collection Unnesting
    URL: http://www.znow.com/sales/oracle/appdev.816/a76976/adobjmng.htm#1002885
    Oracle8i also supports the following syntax to produce outer-join results:
    SELECT d.*, e.* FROM depts d, TABLE(d.emps)(+) e;
    The (+) indicates that the dependent join between DEPTS and D.EMPS should be NULL-augmented. That is, there > will be rows of DEPTS in the output for which D.EMPS is NULL or empty, with NULL values for columns
    corresponding to D.EMPS.

  • Viewing custom Z tables with blank authorization group

    I'm trying to view all the Z tables without any authorization group (blank) in TDDAT.  It only displays Z tables with &NC& or other valid groups we assign.  Is there another table I can query to show ALL Z tables without an auth group?
    Thanks.

    > It only displays Z tables with &NC& or other valid groups we assign. 
    Oops, sorry. Martin had already mentioned this.
    &NC& is not a valid group, it is a symbolic group which is the equivalent of a blank for the table - except that a view had been created for it and during that process no authorization group was set either. This also used to be the default, which doesn't really make sense... hence all the values.
    If you take a look at FM VIEW_AUTHORITY_CHECK then you will see how it works and which tables are used.
    Cheers,
    Julius
    Edited by: Julius Bussche on Feb 13, 2010 10:01 AM

  • SAP tables with &NC& Auth Group.

    In SAP there are about 7000 plus tables with &NC& Auth Group.
    Are all these tables not financial relevant.
    What is the impact if we change these tables auth group to custom auth groups?

    On their own they might not be finance relevant, but might even be system relevent for that matter.
    &NC& means "Not Classified" hich should be understood as "no intention to display and or change them from the application layer" as their single fields on their own are not usefull or inconsistent.
    The bugger is that if developers don't understand this and security folks don't respect it, then because of one single table you might open access to all other unclassified tables (depending on how they are designed in the Data Dictionary and how they are accessed).
    I have seldom seen a SAP system which got this right, primarily because of the developers (also the ones from SAP).
    Yes, you can change the groups is SE54. But report it to SAP and keep track of which SP level introduces the new check value. Try to obtain that information from them in advance if you need to, and check that it is conceptually consistent with your concept (minimum requirement is that it should not be conceptually inconsistent with other SAP standard concepts).
    If this is a topic for you and delivery classes also play a role, then also search OSS for the term "Current Settings". These give you more options - for specific objects.
    Cheers,
    Julius

  • Populate table with refresh group outcome

    Hi everyone,
    I need a little help.
    I am working on an Oracle 10.2.0.4 in Windows environment.
    I have a table I created like this:
    Table name: DIM_REPLICA
    COD_SEZ VCHAR2(2)
    NOME_SEZ VCHAR2(20)
    FLAG CHAR(1)
    D_REPLICA DATE
    On this DB I have 210 refresh groups executing every night. I need to populate this table with the outcome of the refresh groups.
    So when the refresh group called for example ROME runs I need written on the table the name ROME in the "NOME_SEZ" field, a Y or a N if the refresh group worked correctly in the FLAG field and the LAST_DATE the refresh group ran in the D_REPLICA field. The COD_SEZ field is a code I get from other things. It is not needed at the moment. I can add it myself on me own.
    Can anyone please help me?
    I was looking on SYS tables DBA_JOBS and DBA_REFRESH for this data, but I am not sure what to take and how to populate the table. Trigger? Procedure? Any help will be great!
    Thank you all in advance!

    Hi Phelit,
    After update trigger may help you with few customization
    Refer sample code
    CREATE OR REPLACE TRIGGER orders_after_update
    AFTER UPDATE
       ON orders
       FOR EACH ROW
    DECLARE
       v_username varchar2(10);
    BEGIN
       -- Find username of person performing UPDATE into table
       SELECT user INTO v_username
       FROM dual;
       -- Insert record into audit table
       INSERT INTO orders_audit
       ( order_id,
         quantity_before,
         quantity_after,
         username )
       VALUES
       ( :new.order_id,
         :old.quantity,
         :new.quantity,
         v_username );
    END;Thanks,
    Ajay More
    http://www.moreajays.com

  • Geometry Tables on MapBuilder show only 5 tables of 25 tables with sdo

    Hi,
    I have 25 tables with sdo column and data in my database. But I can only see 5 tables under directory Geometry Tables on MapBuilder. Why can other tables not be displayed? Any idea???
    Thank you

    Yes, manually! Assuming your data is long/lat srid 8311:
    INSERT INTO USER_SDO_GEOM_METADATA (
      table_Name, column_name, srid, diminfo
    ) values (
      'MISSING_TABLE1','GEOM',8311,MDSYS.SDO_DIM_ARRAY(
    MDSYS.SDO_DIM_ELEMENT('X',-180,180,0.005),
    MDSYS.SDO_DIM_ELEMENT('Y',-90,90,0.005))
    );<shameless_plug ignore_level="HIGH" contact_email="simon at spatialdbadvisor dot com">
    On my website (http://www.spatialdbadvisor.com/file_download/18) there are some free downloadable pl/sql tools. In these tools there is a package called TOOLS which has a procedure as follows:
       Procedure MetadataAnalyzer( p_table_regex             IN VARCHAR2 := '*',
                                   p_fixed_srid              IN NUMBER   := -9999,
                                   p_fixed_diminfo           IN MDSYS.SDO_DIM_ARRAY := NULL,
                                   p_spindex_tablespace      IN VARCHAR2 := NULL,
                                   p_spindex_work_tablespace IN VARCHAR2 := NULL,
                                   p_pin_non_leaf            IN BOOLEAN  := FALSE,
                                   p_stats_percent           IN PLS_INTEGER := 100,
                                   p_min_projected_tolerance IN NUMBER := 0.00005 );Which you would execute from sqlplus as follows (assume the package is installed in the CODESYS schema):
    SQL> execute codesys.TOOLS.MetadataAnalyzer;It will discover your tables with sdo_geometry columns and try and construct user_sdo_geom_metadata entries for them via querying user_tab_columns. It will also build spatial indexes and ensure database statistics are gathered.
    Try it and see if it works for you. If you have problems, just email me for help.
    </shameless plug>
    regards
    Simon

  • Error while importing a table with BLOB column

    Hi,
    I am having a table with BLOB column. When I export such a table it gets exported correctly, but when I import the same in different schema having different tablespace it throws error
    IMP-00017: following statement failed with ORACLE error 959:
    "CREATE TABLE "CMM_PARTY_DOC" ("PDOC_DOC_ID" VARCHAR2(10), "PDOC_PTY_ID" VAR"
    "CHAR2(10), "PDOC_DOCDTL_ID" VARCHAR2(10), "PDOC_DOC_DESC" VARCHAR2(100), "P"
    "DOC_DOC_DTL_DESC" VARCHAR2(100), "PDOC_RCVD_YN" VARCHAR2(1), "PDOC_UPLOAD_D"
    "ATA" BLOB, "PDOC_UPD_USER" VARCHAR2(10), "PDOC_UPD_DATE" DATE, "PDOC_CRE_US"
    "ER" VARCHAR2(10) NOT NULL ENABLE, "PDOC_CRE_DATE" DATE NOT NULL ENABLE) PC"
    "TFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 STORAGE(INITIAL 65536 FREELISTS"
    " 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "TS_AGIMSAPPOLOLIVE030"
    "4" LOGGING NOCOMPRESS LOB ("PDOC_UPLOAD_DATA") STORE AS (TABLESPACE "TS_AG"
    "IMSAPPOLOLIVE0304" ENABLE STORAGE IN ROW CHUNK 8192 PCTVERSION 10 NOCACHE L"
    "OGGING STORAGE(INITIAL 65536 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEF"
    "AULT))"
    IMP-00003: ORACLE error 959 encountered
    ORA-00959: tablespace 'TS_AGIMSAPPOLOLIVE0304' does not exist
    I used the import command as follows :
    imp <user/pwd@conn> file=<dmpfile.dmp> fromuser=<fromuser> touser=<touser> log=<logfile.log>
    What can I do so that this table gets imported correctly?
    Also tell me "whether the BLOB is stored in different tablespace than the default tablespace of the user?"
    Thanks in advance.

    Hello,
    U can either
    1) create a tablespace with the same name in destination where you are trying to import.
    2) get the ddl of the table, modify the tablespace name to reflect the existing tablespace name in destination and run the ddl in the destination database, and run your import command with option ignore=y--> which will ignore all the create errors.
    Regards,
    Vinay

  • Multiple tables with the possibility of multiple records in each table

    Post Author: viper
    CA Forum: .NET
    Hi
    I have been trying for a few days now to come up with a CR solution to displaying data from multiple tables.  These tables, in some cases, have more then one record that needs to be displayed.  This is basically what I am trying to do.....
    I am developing a .net web application(vb) using vs2005 and an oracle 10g backend.  There is a data entry part of the site that users will enter data related to a property.  Other users will be able to search these records and have a list of records returned based on the search criteria.  The user then can click on one of these records to view a pop up CR report containing all the data related to that one property.  The PropID is passed to the pop up page and is used in the WHERE clause of my SQL statement to bring back only one property.  This data can come from as many as 18 tables if all the fields have been entered for this property.  I have tried many different solutions to get the data from multiple tables...and have had some that were close to what I need.  The best one I have will display data from multiple tables but only one record per table.....which doesn't work in my case since some of the tables have more then one record per table.
    Is there anybody that has had success in setting up similar reports?
    Does anybody know how I could use the "Group Expert" to group by the tables in my application?  I can only figure out how to group within a single table.
    It would be great if I could group by table....then just display the record(s) in each table that had the same PropID.  I am not sure if the pdf export would show all the data in that situation but it would be worth a try.  If fact...maybe I could create a new table called MyTables and just add two colums like MyTableID and MyTableName.  Then add all the table names to MyTables that I want to see in the report and add the associated MyTableID value to each table as a new column.  I could then group by MyTableID and PropID.  Just guessing here.
    Any ideas would be appreciated.

    Post Author: quafto
    CA Forum: .NET
    Your query is not too clear so I'll do my best to answer it broadly.
    You mentioned that you have a .NET web application where your users enter data on one screen and then may retrieve it on another. If the data is written in real time to a database then you can create a standard Crystal Report by adding multiple tables. The tables should be linked together using the primary and foreign keys in order to optimize the database query and give you a speedy report. Using unlinked tables is not recommended and requires the report engine to index the tables (it is quite slow).
    You also mentioned you have a "PropID" to be used in a WHERE clause. This is a great place to use a parameter in your report. This parameter can then be used in your record selection formula inside Crystal Reports. The report engine will actually create the WHERE clause for you based on the parameter value. This is helpful because it allows you to simply concentrate on your code rather than keeping track of SQL queries.
    Now, what Crystal does not do well with is uncertainty. When you design a report with X number of tables the report engine expects X number of tables to be available at processing time. You should not surprise the print engine with more or less tables because you could end up with processing errors or incorrect data. You may need to design multiple reports for specific circumstances.
    Regarding the group expert question. I'm not sure how you would/could use the group expert to group a table? A table is a collection of fields and cannot be compared to another table without a complex algorithm. The group expert is used to group and sort records based on a field in the report. Have a look at the group expert section of the help file for more information.
    Hopefully my comments have given you a few ideas.

  • No data found error on Form on a Table with report

    Hi Everyone, I'm using Application Express 4.1.0.00.32 on Windows 7. I built a Form on a table with report. Earlier I was using rowid as a passing parameter but then I had to change it to primary key column from report to form.
    So in the "Fetch row process" I changed the "Items containing primary key value" and "Primary Key column" to P1004_PERSON_ID and PERSON_ID respectively. Which is my primary key.
    My Form is working exactly fine but at on point it throws "no data found error".
    I have a required date field in the form. So if the user doesn't fill in the date field and try to save the form, it throws the "Feild required error" and then when user enters date and try to save then it throws the error "No data found.". here is the snapshot... snapshot
    How can I fix this error.I'm really stuck.
    I checked debubber..it is as follows... in debughger it's still showing rowid. I don't know why. How can I fix that.
    Execution
    Message
    Level
    Graph
    0.00233
    0.00932
    S H O W: application="101" page="1004" workspace="" request="" session="123235901404364"
    4
    0.01161
    0.00102
    Language derived from: FLOW_PRIMARY_LANGUAGE, current browser language: en-us
    4
    0.01261
    0.00046
    alter session set nls_language="AMERICAN"
    4
    0.01307
    0.00042
    alter session set nls_territory="AMERICA"
    4
    0.01348
    0.00053
    NLS: CSV charset=WE8MSWIN1252
    4
    0.01401
    0.00042
    ...NLS: Set Decimal separator="."
    4
    0.01443
    0.00053
    ...NLS: Set NLS Group separator=","
    4
    0.01495
    0.00050
    ...NLS: Set g_nls_date_format="DD-MON-RR"
    4
    0.01545
    0.00051
    ...NLS: Set g_nls_timestamp_format="DD-MON-RR HH.MI.SSXFF AM"
    4
    0.01597
    0.00050
    ...NLS: Set g_nls_timestamp_tz_format="DD-MON-RR HH.MI.SSXFF AM TZR"
    4
    0.01647
    0.00079
    ...Setting session time_zone to -05:00
    4
    0.01726
    0.00046
    Setting NLS_DATE_FORMAT to application date format: DD-MON-YYYY
    4
    0.01772
    0.00060
    Setting NLS_TIMESTAMP_FORMAT to application timestamp format: DD-MON-YYYY HH24.MI.SSXFF
    4
    0.01832
    0.00092
    ...NLS: Set g_nls_date_format="DD-MON-YYYY"
    4
    0.01924
    0.00049
    ...NLS: Set g_nls_timestamp_format="DD-MON-YYYY HH24.MI.SSXFF"
    4
    0.01973
    0.00083
    ...NLS: Set g_nls_timestamp_tz_format="DD-MON-RR HH.MI.SSXFF AM TZR"
    4
    0.02056
    0.00099
    NLS: Language=en-us
    4
    0.02154
    0.00157
    Application 101, Authentication: PLUGIN, Page Template: 5091946581246503
    4
    0.02312
    0.00065
    ...fetch session state from database
    4
    0.02377
    0.00106
    fetch items
    4
    0.02483
    0.00065
    ...fetched 103 session state items
    4
    0.02548
    0.00194
    Authentication check: NTLM (NATIVE_CUSTOM)
    4
    0.02742
    0.00188
    ...Execute Statement: begin declare begin wwv_flow.g_boolean := f_ntlm_page_sentry_parm; end; end;
    4
    0.02930
    0.00050
    ... sentry+verification success
    4
    0.02980
    0.00042
    ...Session ID 123235901404364 can be used
    4
    0.03021
    0.00114
    ...Application session: 123235901404364, user=VARMAN01
    4
    0.03135
    0.00162
    ...Check for session expiration:
    4
    0.03297
    0.00075
    Session: Fetch session header information
    4
    0.03372
    0.00113
    ...Setting session time_zone to -5:00
    4
    0.03485
    0.00080
    Branch point: Before Header
    4
    0.03565
    0.00598
    Fetch application meta data
    4
    0.04165
    0.00081
    ...metadata, fetch computations
    4
    0.04245
    0.00076
    ...metadata, fetch buttons
    4
    0.04321
    0.00086
    Setting NLS_DATE_FORMAT to application date format: DD-MON-YYYY
    4
    0.04406
    0.00058
    Setting NLS_TIMESTAMP_FORMAT to application timestamp format: DD-MON-YYYY HH24.MI.SSXFF
    4
    0.04464
    0.00049

    Just an observance... SQL is still showing the rowid instead of the P1004_PERSON_ID ??
    where "PERSON_ID" = :p_rowid;
    should it not be :
    where "PERSON_ID" = :P1004_PERSON_ID:
    thx, Bill

Maybe you are looking for

  • Is it possible to combine two existing iTune accounts and then cancelling one? Many thanks.

    I am trying to combine two accounts that I have on iTunes (created separately over the years) so as to then delete/cancel one to only have one active account (with all of my combined purchases, etc. on this combined account). Is this possible, or is

  • Can't transfer files from imac to intel imac via ethernet sockets

    I recently bought the fab new imac intel and wanted to transfer files from my old imac 350 via the ethernet sockets as the old imac doesn't have firewire. I did this using instructions from an apple doc. which allowed me to simply drag files from the

  • ITunes 8 not responding

    When I open iTunes 8 it looks like it starts "Genius - Gathering information about your library" and it starts downloading something. Then it immediately hangs. The task manager says iTunes is not responding. I cannot make windows vista kill the proc

  • Cube measures friendly names

    Hi, We want to display freindlier names for certain cube measures in the Performance Point dashboard grid. How is it possible? And if changing the measure name in the cube is the only option, is there someplace where we can note the more technical ex

  • Firefox wants to save a pdf I select online. How can I just read it?

    When I select a pdf online, Firefox is set to save the file somewhere. How can I change this so that I can just read the pdf, then decide to save it later?