Query with two spatial operators

Hi,
I need prepare query with sdo_any_interact and sdo_filter
Following query doesn't work any ideas?
SELECT ROWID, GEOMETRY, 'MVDEMO:L.MAJOR TOLL ROAD', null, 'null', -1, 'rule#0'
FROM PARCELS P
WHERE SDO_ANYINTERACT(P.GEOMETRY,
(SELECT L.GEOMETRY
FROM SHP_SIMPLYFIED L
WHERE L.TASK = '4')) = 'TRUE'
and MDSYS.SDO_FILTER(P.GEOMETRY
, MDSYS.SDO_GEOMETRY(2003
, 2180
, NULL
, MDSYS.SDO_ELEM_INFO_ARRAY(1, 1003, 3)
, MDSYS.SDO_ORDINATE_ARRAY(482850, 236980, 510333, 248133))
--, MDSYS.SDO_ORDINATE_ARRAY(:MVQBOXXL, :MVQBOXYL, :MVQBOXXH, :MVQBOXYH))
, 'querytype=WINDOW') = 'TRUE'
Kind regards,
Tomek

Hi Jack,
Join - the same error:
the error is
ORA-00904: "MDSYS"."SDO_PQRY": invalid identifier
00904. 00000 - "%s: invalid identifier"
*Cause:
*Action:
Error at Line: 13 Column: 60
TASK column - is not null, unique
parcels are partitioned table (3 000 000 rows)
i think this error is connected with partitoning
in the first version i put any_interact into view with read only option
select * from this view works fine but take a long time,
next i build theme in MapBuider but preview return error (same), (MapBuilder buid query on view and add query_window filter to reduce number of objects)
Thx,
Tomek

Similar Messages

  • Crystal report based on BW query with two structures

    Hi,
    I use a BW query with 2 structures. In the rows there is a structure of restricted characteristic 0material. I used this characteristics several times in different rows to restrict these rows to specific products.
    Cars
    motorcycles
    Others
    In the columns I have a structure of key figures. Every key figure is restricted to a specific time intervall.
    So in BW the executed query looks like this:
                           Key figure 1         Key figure 2        Key figure 3
      Cars                   10                     30                         100
      motorcycles        20                   100                          30
      Others                30                    40                           39
    If I use the same query in Crystal then I have access to the 3 keyfigures and to one structure element.
    How can I ensure that the query is displayed in CR like in BW? I tried to work with crosstabs but I was not able to get the same display like in BW.
    Thanks for any help.
    BR, Andreas

    Try posting your question to the BW / SAP forum.

  • Query with two registers, when i use two taxcode

    Hi everybody, my question in this opportunity, it's about  this query:
    /*LIBRO DE COMPRAS CELULAR STRA S.A. DE C.V.*/
    SELECT T0.[TaxDate] Fecha,
           T0.[NumAtCard] 'DOCUMENTO',
           T1.[U_RegIva] 'NRC',
           T0.[CardCode] 'CODIGO DE PROVEEDOR',
           T1.[U_NIT] 'NIT',
           T0.[CardName] 'NOMBRE DE PROVEEDOR',
           SUM(CASE 
                  WHEN T2.[TaxCode] = 'IVAEXE' THEN T2.[LineTotal]
                  ELSE 0
               END) 'LOCALES EXENTAS',
           0.00 ImportacionesExentas,
            (SELECT sum(T12.[LineTotal]) FROM PCH1 T12 INNER JOIN OPCH T10 ON T12.[DOCENTRY] = T10.[DOCENTRY] WHERE T12.[AcctCode] != '11209' AND T12. [TaxCode]  = 'IVACCF' AND T12.[DOCENTRY] = T0.[DOCENTRY]  AND T10.[TaxDate] >= '[%0]' and T10.[TaxDate] <= '[%1]') 'LOCALES GRAVADAS',
            0.00 Importaciones,
            T0.[VatSumSy] 'CREDITO FISCAL',
                  T0.[DocTotal]+
    T0.[DocTotal] -(CASE
                         WHEN  T2.[ACCTCODE] = '11209'
                         THEN ((SELECT (T12.[LineTotal]*-1)
                         FOM PCH1 T12
              INNER JOIN OPCH T10 ON T12.[DOCENTRY] = T10.[DOCENTRY]
                    WHERE T12.[AcctCode] = '11209' AND
                    ---T12.[TaxCode]  = 'IVACCF' AND
                     (T12.[DOCENTRY] = T0.[DOCENTRY])  AND
                         T10.[TaxDate] >= '[%0]' and T10.[TaxDate] <= '[%1]'))
                           ELSE T0.[DOCTOTAL] END) 'TOTAL COMPRAS', --This statement, cause the error, or,  think so i
            (SELECT SUM(T13.[WTAMNT]) FROM PCH5 T13 WHERE (T13.[WTCode] = 'RET1' OR T13.[WTCode] = 'RET2') AND T13.[ABSENTRY] = T0.[DOCENTRY] )'RETENCION IVA',
           0.00 ComprasExcluidos
    FROM OPCH T0
       INNER JOIN OCRD T1 ON T0.[CardCode] = T1.[CardCode] INNER JOIN PCH1 T2 ON T0.[DocEntry] = T2.[DocEntry]
    WHERE T0.[TaxDate] >= '[%0]' and T0.[TaxDate] <= '[%1]' AND T1.[Country] = 'SV' AND T0.[Series] = 7 and
       t0.docnum not in (SELECT distinct T0.[DocNum] FROM [dbo].[OPCH] T0 INNER JOIN [dbo].[PCH1] T1 ON T0.DocEntry = T1.DocEntry
                                                                          inner join RPC1 T2 on t1.trgetEntry=t2.docentry INNER JOIN ORPC T3 ON T2.DocEntry = T3.DocEntry
                         WHERE T3.[TaxDate] >= '[%0]' and  T3.[TaxDate] <= '[%1]' and t3.series=9) AND
          T0.NumAtCard NOT LIKE '%F%' AND
          T0.NumAtCard NOT LIKE '%REDIGIT%'
    GROUP BY T0.[TaxDate],
             T0.[DocNum],
             T0.[CardName],
             T0.[CardCode],
             T1.[U_NIT],
             T0.[VatSumSy],
             T0.[DOCENTRY],
             T0.[DocDate],
             T0.[DOCTOTAL],
             T0.[NumAtCard],
             T1.[U_RegIva],
            T2.[AcctCode],
            T0.[DocTotal]
    the result shows two line with the information of one vendor invoice,
    example:
    numatcard     cardcode      tax exempt     local shopping   tax     total
    12345           0125             0.00             100         13      115
    12345           0125             2.00             100         13      115
    i think this be must to tax indicator, because in the document i use two diferent taxcode. i need help to avoid this error, if somebody know how resolved, me will great util

    Well Gordon,
    If you see in the statement, the register is in one line:
    (SELECT sum(T12.[LineTotal]) FROM PCH1 T12 INNER JOIN OPCH T10 ON T12.[DOCENTRY] = T10.[DOCENTRY] WHERE T12.[AcctCode] != '11209' AND T12. [TaxCode] = 'IVACCF' AND T12.[DOCENTRY] = T0.[DOCENTRY]  AND T10.[TaxDate] >= '[%0]' and T10.[TaxDate] <= '[%1]')
    to better expalin.
    i have this line  without tax, i only need a statement in the that be sum, the line of tax exempt + line without tax + tax total.
    if you see in the query, i've excluded the acctcode = '11209', really without this filter, only  i need select the doctotal to view the result. but if, i do a statement where only excluide the document line where appear this account, the quey returns a wrong

  • Cl_rsr_chabit error while runing query with two new Nav attributes

    hi gurus,
    we mark two attributes as navigational and transport to production now the problem is when I run the query on those navigational attributes it is throwing me error as below:
    System error in programme CL_RSR_CHABIT and form SET_BITI-02(see long text)
    programme rror in class SAPMSSY1 method uncaughjt exception.
    and when I ran try to extract data on existing report from these attributes then it is showing me no data.Pls advice
    Thanks
    R

    Hello Michel,
    we faced exaclty the same problem today - re-activating the multiprovider solved the problem.
    Kind regards,
    Thomas

  • Query with two filter prompts(phase and document)

    Hi All,
    I am new to sap sourcing.
    I am trying to customize a query for (Sourcing Report for all supplier registrations showing the cycle times for each
    approval phase of the process)which I have added two filter prompts(phase and document name).
    When I try to execute the query, I don't get the required output for the phase filter prompt.
    Also phase is a value list and when I select the phase from the drop down, the report doesn't give any value.
    Please find the query as mentioned.
    SELECT <%RESULTS%>
    FROM <%SCHEMA%>.FCI_WORK_ITEM
    T1
    INNER JOIN <%SCHEMA%>.FCI_WORK_PROCESS T2 ON T1.PARENT_OBJECT_ID =
    T2.OBJECTID INNER JOIN (
    SELECT
    OBJECTID,
    10002203 AS
    CLASSID,
    CREATED_BY_USER_OBJECT_ID,
    CREATED_BY_USER_CLASS_ID,
    CREATED_BY_USER_OBJECT_NAME,
    CREATED_AT,
    EDIT_AT_DATETIME, MODIFIED_AT
    FROM
    <%SCHEMA%>.ODP_ODP_VEN_MODIFICATION_WF
    WHERE
    CONTEXTID=<%CONTEXT(odp.vendormgmt.wf_vendor_modification)%>
    UNION
    ALL
    SELECT
    OBJECTID,
    10002213 AS
    CLASSID,
    CREATED_BY_USER_OBJECT_ID,
    CREATED_BY_USER_CLASS_ID,
    CREATED_BY_USER_OBJECT_NAME,
    CREATED_AT,
    EDIT_AT_DATETIME, MODIFIED_AT
    FROM
    <%SCHEMA%>.ODP_ODP_VEN_REGISTRATION_WF
    WHERE
    CONTEXTID=<%CONTEXT(odp.vendormgmt.wf_vendor_registration)%>
    T3 ON
    T3.OBJECTID = <%COALESCE%>(T1.ROOT_PARENT_OBJECT_ID,
    T1.BIZ_DOC_OBJECT_ID) AND
    T3.CLASSID = CASE WHEN
    T1.ROOT_PARENT_OBJECT_ID IS NULL THEN T1.BIZ_DOC_CLASS_ID ELSE
    T1.ROOT_PARENT_CLASS_ID END
    WHERE
    T1.CONTEXTID=<%CONTEXT(workflow.process)%> AND
    (T2.PHASE_SUB_REF_OBJECT_NAME like ?OR T2.BIZ_DOC_OBJECT_NAME like
    <%ORDERBY%>
    Please suggest how can I change the query accordingly.
    Also , please suggest how can add the result fields for calculating the duration(created at - Action date).
    Please do the needful.
    Thanks and Regards
    Ganga

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             Hello Vignesh,
    Thank you!!
    I could find that only the supplier registration modifications are included in the query given by you, but we need to include the supplier registrations as well.
    I tried modifying the query and it worked.
    But, now the challenge is to include the workflow status(T1.APPROVAL_STAUS) in the filter prompt.
    T1 table is FCI_WORK_ITEM.
    T.APPROVAL_STAUS is an integer data type in the table.
    I defined the T.APPROVAL_STAUS as string In Result fields and in the filter prompt.
    But the query works for other filter prompts except workflow status.
    I have included the filter prompts as mentioned below:
    T1.CONTEXTID=<%CONTEXT(workflow.process)%> AND
    UPPER(T2.BIZ_DOC_OBJECT_NAME) like ? AND
    UPPER(T2.PHASE_SUB_REF_OBJECT_NAME) like ? AND
    UPPER(T1.APPROVAL_STATUS) like ? AND
    UPPER(T1.PERFORMER_OBJECT_NAME) like ?
    <%ORDERBY%>
    Please suggest on this.
    Thanks and Regards
    Ganga Durga

  • Query with two where conditions

    HI
    SELECT ENAME FROM EMP WHERE
    SAL > 1000 AND JOB='CLERK';
    How to implement in CMP(Entity bean)
    thank u

    at this point mapping to do this king of query would be on the container specific file. I will tellyou how this is done on a Orion App server. I bet that others are close to the same.
    first you make a finder method in your bean for the enploy name:
    Collection findBigClerk();
    Orion generates a file from the ejb-jar.xml file called orion-ejb-jar.xml. this is where the O/R mapping is changed for the beans.
    each method in a bean has short definition
    <finder-method query="EMP.SAL>1000 and EMP.JOB='CLERK'">
    Assuming that the CMP is mapped to the EMP table when you call findbigClerk it will add the above query to as a WHERE clause.
    Then get the name from the interface.
    Again, this is how I would do this on an Orion App server. Others will be simular until O/R mapping is moved from server-specific to the ejb-jar.xml file
    hope this helps a little

  • Best practice for use of spatial operators

    Hi All,
    I'm trying to build a .NET toolkit to interact with Oracles spatial operators. The most common use of this toolkit will be to find results which are within a given geometry - for example select parish boundaries within a county.
    Our boundary data is high detail, commonly containing upwards of 50'000 vertices for a county sized polygon.
    I've currently been experimenting with queries such as:
    select
    from
    uk_ward a,
    uk_county b
    where
    UPPER(b.name) = 'DORSET COUNTY' and
    sdo_relate(a.geoloc, b.geoloc, 'mask=coveredby+inside') = 'TRUE';
    However the speed is unacceptable, especially as most of the implementations of the toolkit will be web based. The query above takes around a minute to return.
    Any comments or thoughts on the best practice for use of Oracle spatial in this way will be warmly welcomed. I'm looking for a solution which is as quick and efficient as possible.

    Thanks again for the reply... the query currently takes just under 90 seconds to return. Here are the results from the execution plan ran in sql*:
    Elapsed: 00:01:24.81
    Execution Plan
    Plan hash value: 598052089
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 156 | 46956 | 76 (0)| 00:00:01 |
    | 1 | NESTED LOOPS | | 156 | 46956 | 76 (0)| 00:00:01 |
    |* 2 | TABLE ACCESS FULL | UK_COUNTY | 2 | 262 | 5 (0)| 00:00:01 |
    | 3 | TABLE ACCESS BY INDEX ROWID| UK_WARD | 75 | 12750 | 76 (0)| 00:00:01 |
    |* 4 | DOMAIN INDEX | UK_WARD_SX | | | | |
    Predicate Information (identified by operation id):
    2 - filter(UPPER("B"."NAME")='DORSET COUNTY')
    4 - access("MDSYS"."SDO_INT2_RELATE"("A"."GEOLOC","B"."GEOLOC",'mask=coveredby+i
    nside')='TRUE')
    Statistics
    20431 recursive calls
    60 db block gets
    22432 consistent gets
    1156 physical reads
    0 redo size
    2998369 bytes sent via SQL*Net to client
    1158 bytes received via SQL*Net from client
    17 SQL*Net roundtrips to/from client
    452 sorts (memory)
    0 sorts (disk)
    125 rows processed
    The wards table has 7545 rows, the county table has 207.
    We are currently on release 10.2.0.3.
    All i want to do with this is generate results which fall in a particular geometry. Most of my testing has been successful i just seem to run into issues when querying against a county sized polygon - i guess due to the amount of vertices.
    Also looking through the forums now for tuning topics...

  • Select query with UNION clause in database adapter

    Friends,
    I have got a SQL query with two UNION clause withing it. like
    select a,b,c
    from a
    union
    select a,b,c
    from b
    The schema generated is like below in sequence
    <element>a</element>
    <element>b</element>
    <element>c</element>
    <element>a</element>
    <element>b</element>
    <element>c</element>
    So, the columns from different select queries joined with UNION clause are all appeared in schema instead of the distinct columns.
    Is there any way around to solve this issue ? or will need to with DB function/procedure.

    I think I know what you are saying but your example doesn't make sense, your SQL should produce something like
    I had to change a, b, c with elementA, elementB, elementC as a and b are reserved html tags.
    <elementA>DateA</elementA>
    <elementB>DataB</elementB>
    <elementC>DataC</elementC>
    ...What is the result of the query when you run it in SQLPlus? Is it what you expect?
    cheers
    James

  • Send values to IN query with parameter

    Subject: send values to IN query with parameter
    Hello. Hope I'll explain my problem well enough:
    I have a query:
    -- select id from table where id in ('100')
    Now I used parameter for the IN part:
    -- select id from table where id in (:param)
    and I gave the parameter the value 100.
    now I want to have the query with two values:
    -- select id from table where id in ('100','200')
    I tried to use the parameter and give him the value of: '100','200'.
    It didn't worked :(
    Is there a syntax to give the parameter more then one value for the IN query (with out using another table or function etc')?
    Thanks in advance,Roy.

    This is the best solution I have for it.
    variable parameter varchar2(4000);
    exec :parameter := 'SYSTEM,SYS';
    select username
    from dba_users
    where username in ( select COLUMN_VALUE from table  (split_string(:parameter,',')))It uses this function
    CREATE OR REPLACE
    type string_table  as table of varchar2(4000)
    CREATE OR REPLACE
    FUNCTION split_string (
         string IN varchar2,
        delimiter IN varchar2
    ) RETURN  string_table IS
         tab string_table;
         pre integer;
         post integer;
         step integer;
         i integer;
    BEGIN
         pre := 1;
         step := length(delimiter);
         i := 0;
         tab := string_table();
         loop
              tab.extend;
              i := i + 1;
              post := instr(string,delimiter,pre);
              if ( post = 0 ) then
                   tab(i) := substr(string,pre);
                   return tab;
              end if;
              tab(i) := substr(string,pre,post-pre);
              pre := post + step;
         end loop;
    END;
    /Bye Alessandro

  • Query with 2 variables

    I have a query with two variables (Employee and Date). The query is working fine if both of the variables are check and values assigned. But if only one variable is checked and a value assigned then the query will return 0 results. Is it possible that the query cannot work with only one variable out of the 2? Do I need a workaround or am i doing something wrong?
    Here is the query:
    SELECT T0.DocNum, T0.DocDate, T0.DocDueDate, T0.CardCode, T0.CardName, T0.Address, T0.DocTotal, T0.U_Employee, T1.firstName,T1.lastName,  T0.Comments FROM OVPM T0 LEFT JOIN OHEM T1 ON T0.U_EMPLOYEE = T1.FIRSTNAME' 'T1.LASTNAME WHERE T0.DocType = 'A' AND T0.U_EMPLOYEE = [%0] AND T0.DocDate =[%1].
    Thank you so much for your help,
    Irina Stanca

    AFAIK, at least with 'complex queries' unchecked parameter gets
    some default/blank value. Therefore, you should allow default values in your
    WHERE clause.
    You want: WHERE T0.COL = @VAR
    You write: WHERE (T0.COL = @VAR OR [logical test for @VAR is a default value])
    Snippets like this may help you in finding out that default value:
    -- snip --
    /SELECT FROM [dbo].[OHEM] T9/
    declare @VAR_EMPL as char(20)
    /* WHERE */
    set @VAR_EMPL = /* T9.lastName */ '[%0]'
    /SELECT FROM [dbo].[OVPM] T8/
    declare @VAR_DATE as char(20)
    /* WHERE */
    set @VAR_DATE = /* T8.DocDate */ '[%1]'
    SELECT '@VAR_EMPL: ' + '|' + @VAR_EMPL + '|' +  '@VAR_DATE: ' + @VAR_DATE + ' DATEDIFF: ' + cast(DATEDIFF(day, CAST('1900-01-01' as datetime), CAST(@VAR_DATE as datetime)) as varchar)
    [/code]
    -- snip --
    Yes, it looks like the default value for dates is '1900-01-01'.
    Therefore, you may want to code this way
    .. WHERE (DocDate = @VAR_DATE OR DATEDIFF(day, CAST('1900-01-01' as datetime), CAST(@VAR_DATE as datetime)) > 0)
    I also noticed a date-related issue that may cause problems in complex queries
    if you work with dates from last century AND if your date format in B1 is YY instead of CCYY:
    you enter 1907 and B1 interprets it as 2007.
    HTH
    Juha

  • Spatial Query with multiple geometries from 2 tables

    Hi,
    I'm using Oracle 8.1.7. I am trying to do a spatial query on two tables with multiple geometries. There are two spatial tables. One made up of points and one made up of polygons. There are 829551 rows in the table of points and 1817795 rows in the table with polygons...
    I want to find all polygons where one of this points is within it...
    This query is pretty intensive querying two large spatial tables against each other and so I need to find the most efficient way of running this query. I've been running variations of my query for the last two week and every time it's bombed out with various errors after 12-24 hrs processing like out of memory, out of tablespace, out of processing, invalid index etc etc etc. I need to get this query run asap... Any tips would be gratefully appreciated..
    For the session running the query I've allocated 16M sort area with
    ALTER SESSION SET SORT_AREA_SIZE=16777216;
    Below is the query I'm running... How can I improve this please? BTW PARCEL_OVERLAPS contains the points and TP$_PARCEL_AREAS the polygons.
    SELECT lu.LNU_PARCEL_ID
         FROM
              seventy.PARCEL_OVERLAPS po,
              imap_topol.TP$_PARCEL_AREAS pa,
              TP$_PARCEL_CENTROID_AREA pca,
              TDCR_LAND_UNIT lu
         WHERE
              SDO_FILTER(po.geometry, pa.area,
              'querytype=WINDOW') = ’TRUE’ and
              sdo_within_distance(po.geometry,pa.area,'distance=0')='TRUE' and
              pa.delete_date is null and
              Lu.LNU_LAND_UNIT_UNIQUE_NUM = pca.CENTROID_ID and
              pa.AREA_ID = pca.AREA_ID and
              pca.DELETE_DATE IS NULL and
              pa.DELETE_DATE IS NULL;

    Albert,
    Thanks for your reply and the tips you've given. The tp$_parcel_areas table will always be bigger so I've changed the order to sdo_within_distance(pa.area,po.geometry,'distance=0')='TRUE'. The requested counts for those queries are
    12:26:29 [email protected]:SQL> select count(*)
    13:46:22 2 from seventy.PARCEL_OVERLAPS;
    COUNT(*)
    612
    13:48:12 [email protected]:SQL> select count(*)
    13:48:17 2 from imap_topol.TP$_PARCEL_AREAS pa,
    13:48:21 3 TP$_PARCEL_CENTROID_AREA pca
    13:48:21 4 where pca.DELETE_DATE IS NULL
    13:48:21 5 and pa.DELETE_DATE IS NULL
    13:48:21 6 and pa.AREA_ID = pca.AREA_ID;
    COUNT(*)
    1310665
    There was no reason for both filter and within_distance. I did try use the anyinteract but for some reason that does not return the desired results(I've added one id row as a test to make sure it returns desired results). Plus Oracle have recomended using the within distance for better performance..
    so the explan plan for
    14:38:37 [email protected]:SQL> EXPLAIN PLAN FOR
    14:38:50 2 SELECT lu.LNU_PARCEL_ID
    14:38:50 3 FROM
    14:38:50 4 seventy.PARCEL_OVERLAPS po,
    14:38:50 5 imap_topol.TP$_PARCEL_AREAS pa,
    14:38:50 6 TP$_PARCEL_CENTROID_AREA pca,
    14:38:50 7 TDCR_LAND_UNIT lu
    14:38:50 8 WHERE
    14:38:50 9 sdo_within_distance(pa.area,po.geometry,'distance=0')='TRUE' and
    14:38:50 10 pa.delete_date is null and
    14:38:50 11 Lu.LNU_LAND_UNIT_UNIQUE_NUM = pca.CENTROID_ID and
    14:38:50 12 pa.AREA_ID = pca.AREA_ID and
    14:38:50 13 pca.DELETE_DATE IS NULL and
    14:38:50 14 pa.DELETE_DATE IS NULL;
    is
    Plan Table
    | Operation | Name | Rows | Bytes| Cost | Pstart| Pstop |
    | SELECT STATEMENT | | 4G|32920G| 547M| | |
    | NESTED LOOPS | | 4G|32920G| 547M| | |
    | MERGE JOIN | | 547M| 2029G| 230124 | | |
    | SORT JOIN | | 1M| 36M| 85014 | | |
    | MERGE JOIN | | 1M| 36M| 50019 | | |
    | SORT JOIN | | 1M| 17M| 21650 | | |
    | TABLE ACCESS FULL |TP$_PARCE | 1M| 17M| 485 | | |
    | SORT JOIN | | 1M| 22M| 28369 | | |
    | TABLE ACCESS FULL |TDCR_LAND | 1M| 22M| 2127 | | |
    | SORT JOIN | | 42K| 160M| 145111 | | |
    | TABLE ACCESS FULL |TP$_PARCE | 42K| 160M| 12697 | | |
    | TABLE ACCESS FULL |PARCEL_OV | 817 | 3M| 1 | | |
    14:43:14 [email protected]:SQL> explain plan for
    14:43:23 2 SELECT pa.AREA_ID
    14:43:23 3 FROM seventy.PARCEL_OVERLAPS po,
    14:43:23 4 imap_topol.TP$_PARCEL_AREAS pa
    14:43:23 5 WHERE SDO_RELATE(po.geometry, pa.area,'mask=ANTINTERACT querytype=WINDOW') = 'TRUE'
    14:43:23 6 and pa.DELETE_DATE IS NULL;
    Plan Table
    | Operation | Name | Rows | Bytes| Cost | Pstart| Pstop |
    | SELECT STATEMENT | | 6M| 50G| 10M| | |
    | NESTED LOOPS | | 6M| 50G| 10M| | |
    | TABLE ACCESS FULL |PARCEL_OV | 817 | 3M| 1 | | |
    | TABLE ACCESS FULL |TP$_PARCE | 850K| 3G| 12697 | | |
    14:45:03 [email protected]:SQL> explain plan for
    14:45:04 2 SELECT pa.AREA_ID
    14:45:05 3 FROM seventy.PARCEL_OVERLAPS po,
    14:45:05 4 imap_topol.TP$_PARCEL_AREAS pa
    14:45:05 5 WHERE SDO_RELATE(pa.area, po.geometry,'mask=ANTINTERACT querytype=WINDOW') = 'TRUE'
    14:45:05 6 and pa.DELETE_DATE IS NULL;
    Plan Table
    | Operation | Name | Rows | Bytes| Cost | Pstart| Pstop |
    | SELECT STATEMENT | | 6M| 50G| 863554 | | |
    | NESTED LOOPS | | 6M| 50G| 863554 | | |
    | TABLE ACCESS FULL |TP$_PARCE | 850K| 3G| 12697 | | |
    | TABLE ACCESS FULL |PARCEL_OV | 817 | 3M| 1 | | |
    --------------------------------------------------------------------------------

  • Parrallel tables with spatial operators

    I have a point in polygon script that works, but in order to speed up the creation of the point table (~175M rows) I tried adding PARALLEL 4 and /*+ PARALLEL (t,4) */ Only the parallel part is new to the create point table sql.
    I used CTAS to create a point table like this:
    CREATE TABLE &OUT_POINT_SCHEMA..&OUT_POINT_TABLE NOLOGGING PARALLEL 4 TABLESPACE ORDERS_02
    AS
    SELECT /*+ PARALLEL (t,4) */
      cast(lpad(to_char(LON/1000000, '999.000000'),11) || lpad(to_char(LAT/1000000, '99.000000'),10) as varchar2(21))   ULL, 
      MDSYS.SDO_GEOMETRY(2001, 8307, MDSYS.SDO_POINT_TYPE(LON/1000000, LAT/1000000, NULL), NULL, NULL)    GEOM
    FROM
      &IN_POINT_SCHEMA..&IN_POINT_TABLE
    WHERE
      LON is not null
    GROUP BY
      LON, LAT;The spatial index was created like this:
    CREATE INDEX &OUT_POINT_TABLE._SIDX ON &OUT_POINT_TABLE (GEOM) INDEXTYPE IS MDSYS.SPATIAL_INDEX PARAMETERS('TABLESPACE=ORDERS_IDX WORK_TABLESPACE=ORDERS_03 LAYER_GTYPE=POINT');In theory, should the sql still work when I use, for example SDO_INSIDE? Or are there other things that I need to take into consideration? In other words, would the fact that the spatial point table was created with a parallel option impact spatial queries. When I try to monitor the process of the point in polygon sql with a check_session script (I am not a DBA) I see 4 rows with the same sql text which I assume is due to the parallel 4 parameter and I am also seeing wait_events like async descriptor resize and wait_time -1. Sorry to be so vague but I am trying to figure out if this query has a chance of finishing or if i broke it by adding the parallel option. Any guidance or suggestions would be appreciated.
    Thanks,
    David

    Yes, spatial operators (say SDO_INSIDE) can work in parallel queries.
    If you can show us your query explain plan, it will be easier to see
    how SDO_INSIDE is executed.

  • Poor performance with Oracle Spatial when spatial query invoked remotely

    Is anyone aware of any problems with Oracle Spatial (10.2.0.4 with patches 6989483 and 7003151 on Red Hat Linux 4) which might explain why a spatial query (SDO_WITHIN_DISTANCE) would perform 20 times worse when it was invoked remotely from another computer (using SQLplus) vs. invoking the very same query from the database server itself (also using SQLplus)?
    Does Oracle Spatial have any known problems with servers which use SAN disk storage? That is the primary difference between a server in which I see this poor performance and another server where the performance is fine.
    Thank you in advance for any thoughts you might share.

    OK, that's clearer.
    Are you sure it is the SQL inside the procedure that is causing the problem? To check, try extracting the SQL from inside the procedure and run it in SQLPLUS with
    set autotrace on
    set timing on
    SELECT ....If the plans and performance are the same then it may be something inside the procedure itself.
    Have you profiled the procedure? Here is an example of how to do it:
    Prompt Firstly, create PL/SQL profiler table
    @$ORACLE_HOME/rdbms/admin/proftab.sql
    Prompt Secondly, use the profiler to gather stats on execution characteristics
    DECLARE
      l_run_num PLS_INTEGER := 1;
      l_max_num PLS_INTEGER := 1;
      v_geom    mdsys.sdo_geometry := mdsys.sdo_geometry(2002,null,null,sdo_elem_info_array(1,2,1),sdo_ordinate_array(0,0,45,45,90,0,135,45,180,0,180,-45,45,-45,0,0));
    BEGIN
      dbms_output.put_line('Start Profiler Result = ' || DBMS_PROFILER.START_PROFILER(run_comment => 'PARALLEL PROFILE'));  -- The comment name can be anything: here it is related to the Parallel procedure I am testing.
      v_geom := Parallel(v_geom,10,0.05,1);  -- Put your procedure call here
      dbms_output.put_line('Stop Profiler Result = ' || DBMS_PROFILER.STOP_PROFILER );
    END;
    SHOW ERRORS
    Prompt Finally, report activity
    COLUMN runid FORMAT 99999
    COLUMN run_comment FORMAT A40
    SELECT runid || ',' || run_date || ',' || run_comment || ',' || run_total_time
      FROM plsql_profiler_runs
      ORDER BY runid;
    COLUMN runid       FORMAT 99999
    COLUMN unit_number FORMAT 99999
    COLUMN unit_type   FORMAT A20
    COLUMN unit_owner  FORMAT A20
    COLUMN text        FORMAT A100
    compute sum label 'Total_Time' of total_time on runid
    break on runid skip 1
    set linesize 200
    SELECT u.runid || ',' ||
           u.unit_name,
           d.line#,
           d.total_occur,
           d.total_time,
           text
    FROM   plsql_profiler_units u
           JOIN plsql_profiler_data d ON u.runid = d.runid
                                         AND
                                         u.unit_number = d.unit_number
           JOIN all_source als ON ( als.owner = 'CODESYS'
                                   AND als.type = u.unit_type
                                   AND als.name = u.unit_name
                                AND als.line = d.line# )
    WHERE  u.runid = (SELECT max(runid) FROM plsql_profiler_runs)
    ORDER BY d.total_time desc;Run the profiler in both environments and see if you can see where the slowdown exists.
    regards
    Simon

  • Simple spatial query with different SRID

    Can anyone help me with just a real simple spatial query with different SRID.
    Here is the error i get when i perform the query:
    AND SDO_RELATE(A.geometrie_point, B.GEOMETRIE_POLYGONE, 'mask=anyinteract querytype=WINDOW') = 'TRUE'
    ERROR at line 4:
    ORA-00604: error occurred at recursive SQL level 1
    ORA-13207: incorrect use of the [IN COMPATIBLE BOUNDS in SDO_RELATE] operator
    ORA-06512: at "MDSYS.SDO_INDEX_METHOD", line 84
    ORA-06512: at line 4

    Hi,
    I am using 8.1.7.2 and i have the lattest spatial patch.
    From the start i had different SRID. The only thing i changed was the bounds of the coordinate system.
    I reset my bounds of the coordinate system with SRID 8307 to -180,
    180 in X (longitude), and -90,90 in Y (latitude) to see if the query window geometry
    (geom2) will be transformed to the coordinate system of the layer geometries (geom1)
    Her is the content of the user_sdo_geom_metadata :
    GIS_PCP GEOMETRIE_POINT
    SDO_DIM_ARRAY(SDO_DIM_ELEMENT('X', -5800000, 3600000, .00000005), SDO_DIM_ELEMENT('Y', 3516000, 6000000, .00000005))
    82227
    GIS_TEST GEOMETRIE_POLYGONE
    SDO_DIM_ARRAY(SDO_DIM_ELEMENT('X', -180, 180, .00000005), SDO_DIM_ELEMENT('Y', -90, 90, .00000005))
    8307
    Here is my query :
    select /*+ ordered */ A.no_point
    from gis_pcp A, gis_test B
    WHERE SDO_RELATE(A.geometrie_POINT, B.GEOMETRIE_POLYGONE, 'mask=anyinteract querytype=WINDOW') = 'TRUE';
    Here is my result :
    WHERE SDO_RELATE(A.geometrie_POINT, B.GEOMETRIE_POLYGONE, 'mask=anyinteract querytype=WINDOW') = 'TRUE'
    ERROR at line 3:
    ORA-00604: error occurred at recursive SQL level 1
    ORA-13207: incorrect use of the [IN COMPATIBLE BOUNDS in SDO_RELATE] operator
    ORA-06512: at "MDSYS.SDO_INDEX_METHOD", line 84
    ORA-06512: at line 4
    If i change the bounds of GIS_TEST to the exact bouns of GIS_PCP then i dont have the error message above and i have correct results. Do i have the adjust the bounds of every layer to fit the biggest bound?

  • ODCI error with spatial operators

    Hi group,
    I get ODCI errors with spatial operators SDO_RELATE, SDO_FILTER and SDO_WITHIN_DISTANCE (not SDO_NN) called from JDBC (Java 1.2.2).
    For example:
    SELECT A.gid FROM FeatureTable1 A, FeatureTable1 B WHERE B.gid = 3 AND SDO_RELATE(A.Geometry, B.Geometry, 'mask=ANYINTERACT querytype = WINDOW') = 'TRUE';
    Displays the error
    ORA-29902: error in executing ODCIIndexStart() routine
    Other functions such as SDO_AREA, SDO_NN work fine, though.
    Both feature tables where populated with the SDOAPI toolkit and indexed using a fixed index.
    I use a default full install of Oracle 8.1.6 on Linux RedHat 6.2.
    What's wrong? Do I need to install anything else on the server?
    Thanks for any advice.

    Hi Dan,
    There are several errors in the SampleNewToSDO.java sample. The outer polygons should be anti-clockwise, the inner polygons should be clockwise. Now that this is fixed, polygons (with or without inner polygons) do pass the validation test, but multipolygons do not.
    What's wrong with this multipolygon:
    double outerOrdArray1[] = {310, 310, 320, 310, 320, 320, 310, 320, 310, 310};
    LineString outerLineString1 = gF.createLineString(outerOrdArray1);
    double innerOrdArray1[] = {311, 311, 311, 319, 319, 319, 319, 311, 311, 311};
    LineString innerLineStrings1[] = new LineString[1];
    innerLineStrings1[0] = gF.createLineString(innerOrdArray1);
    collection[0] = gF.createPolygon((LineString)outerLineString1,
    (LineString[])innerLineStrings1);
    double outerOrdArray2[] = {410, 410, 420, 410, 420, 420, 410, 420, 410, 410};
    LineString outerLineString2 = gF.createLineString(outerOrdArray2);
    double innerOrdArray2[] = {411, 411, 411, 419, 419, 419, 419, 411, 411, 411};
    LineString innerLineStrings2[] = new LineString[1];
    innerLineStrings2[0] = gF.createLineString(innerOrdArray2);
    collection[1] = gF.createPolygon((LineString)outerLineString2,
    (LineString[])innerLineStrings2);
    geom = gF.createGeometryCollection(collection);
    Note that the sdoapi java library does not detect anything wrong with the geometry (isValid() returns true even when the order of vertices is wrong).
    Heterogenous collections are OK. Only multipolgons are wrong. To check whether the multipolygon was correctly stored in the table, I exported the table to XML using the SampleSDOtoXML.java sample. It looks good:
    <MultiPolygon>
    <Polygon name="0" srsName="0">
    <LineString name="0" srsName="0"> <CList>310.0,310.0 320.0,310.0 320.0,320.0 310.0,320.0 310.0,310.0</CList> </LineString>
    <LineString name="0" srsName="0"> <CList>311.0,311.0 311.0,319.0 319.0,319.0 319.0,311.0 311.0,311.0</CList> </LineString>
    </Polygon>
    <Polygon name="0" srsName="0">
    <LineString name="0" srsName="0"> <CList>410.0,410.0 420.0,410.0 420.0,420.0 410.0,420.0 410.0,410.0</CList> </LineString>
    <LineString name="0" srsName="0"> <CList>411.0,411.0 411.0,419.0 419.0,419.0 419.0,411.0 411.0,411.0</CList> </LineString>
    </Polygon>
    </MultiPolygon>
    So why does SDO_GEOM.VALIDATE_GEOMETRY return 13050? Is there a special vertex ordering rule for multipolygons?
    Thanks,
    Jean-Pierre
    null

Maybe you are looking for

  • Error Installing Windows 8.1 on SSD which is in place of macbook pro's SuperDrive

    I'm trying to install a regular copy of Windows 8.1 pro on an SSD on a Macbook Pro mid 2010. The SSD has been mounted replacing the old, unused SuperDrive with a support to add another disk. After starting the setup and formatting the disk to be read

  • Adobe PDF printer restore

    I have by mistake deleted the Adobe PDF printer ... how do I get this back? Hugh

  • Importing data from third party file with specific layout

    Hello everyone, I have been searching the forum and googling for help on this but so far no success. The issue I have is the following: - I need my client to provide data to me in 2 different dates (Date 1 and Date 2), for example, a bank account bal

  • ITunes 6 opens by itself!

    Hello! Itunes is working great for me...so great that it wants me to keep it open ALL the time. It's sort of comical, but annoying. I quit Itunes...it's definitely shut down. There is no arrow next to the icon in my dock. About a minute later, Itunes

  • Message to all N95 US owners (also known as Nokia ...

    Hi all, we have just received the following notification from the Nokia Software Update team: Nokia N95 US version (also known as N95-3) Nokia is aware of consumers' demand for a new software release, and our development teams are working to produce