Sdo_buffer in Ora 10.2.0.4

Hi,
i'm running 2 dbs (R 10.2.0.4), one with windows and the other with linux. on the windows box the sdo_buffer works fine (buffer is computed) on the linux box the same statement results with 0-buffer.
are there any patch-levels regarding the OS (Windows vs Linux) ?
any suggestion ?
Edited by: juppo007 on 31.03.2010 05:29

the mentioned Geometry (VG-NR 303) is:
MDSYS.SDO_GEOMETRY(2003, 8307, NULL, MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,1), MDSYS.SDO_ORDINATE_ARRAY(9.549311,47.582256,9.538158,47.585304,9.437511,47.538124,9.413537,47.527152,9.415096,47.525301,9.4082739999973,47.5231859999917,9.40340099999,47.5245079999662,9.39151099998129,47.522788999921,9.38488499998607,47.5017699999387,9.36656299998985,47.4897409999214,9.35291899999645,47.4814129999226,9.32933400000691,47.4736129999407,9.32192700000757,47.4675319999569,9.32329200000694,47.4639629999592,9.296199,47.465946,9.269885,47.442812,9.257801,47.432765,9.236555,47.434484,9.228369,47.427478,9.225835,47.421926,9.218038,47.405666,9.233242,47.390199,9.220962,47.382399,9.21453,47.364289,9.18704699917612,47.3476330000881,9.15819899863946,47.3345450000278,9.13039699794128,47.3313260000053,9.09719199683627,47.3356030000608,9.07750499602416,47.3330910000328,9.06074299523214,47.3270099999344,9.04748899453611,47.3296539999761,9.00480999184711,47.3048059993701,9.02681599333377,47.2894889991295,9.04780099456774,47.2860999991797,9.04385099435481,47.2776349989996,9.08639199645546,47.243234998798,9.10253555486423,47.2348670426165,9.10254154254773,47.2348742086742,9.10257121822297,47.2348710220964,9.14843622065071,47.2050760150544,9.14843815723205,47.2050746135459,9.14843986296803,47.2050730790354,9.16672885928311,47.1866410756564,9.1667311353001,47.1866279209723,9.19750399941013,47.1826989994088,9.21036799956856,47.1775509995101,9.22777899972697,47.1821659996551,9.23743599980615,47.1729329997167,9.22177599969553,47.163166999587,9.22073199970725,47.1452329995639,9.312079,47.154466,9.348879,47.144345,9.357753,47.133691,9.395303,47.130117,9.408933,47.110779,9.395013,47.101899,9.376164,47.104069,9.4309719999673,47.0649980001031,9.47076400017053,47.0675829996375,9.47208100016807,47.0606749996371,9.47537300017892,47.0525819996122,9.48229400024704,47.055972999498,9.4860700002689,47.0490269994548,9.49273200035533,47.0561239993296,9.53981500113295,47.0648819984333,9.55913700153588,47.0481209979459,9.60851700321915,47.0633879966931,9.61204700342227,47.0786189967294,9.63337000441301,47.0837039961738,9.63613400461608,47.1011019963159,9.6219190039645,47.1102019968057,9.63534400466573,47.1275999966983,9.62507800417935,47.132149997003,9.62231400410297,47.1508859973095,9.60651900341005,47.149011997604,9.59664800305212,47.1623949979359,9.56584800203848,47.1706919985065,9.57414000230585,47.1795249984619,9.56782300212573,47.1872869986168,9.5844070026886,47.2054869985788,9.56941100221986,47.2188159988816,9.56759500216414,47.2181069988938,9.56042100196281,47.2234909990129,9.55592700183761,47.2218949990421,9.55236800174598,47.2239449990917,9.56674000216596,47.2422629991273,9.53149500129395,47.2699919995746,9.53491100136943,47.2736419995845,9.54827900168831,47.2825619995962,9.55340900182432,47.2906559996459,9.556829,47.298428,9.586776,47.315761,9.597437,47.340921,9.606228,47.35288,9.625868,47.366081,9.656705,47.368383,9.670828,47.377676,9.675451,47.390437,9.672066,47.392043,9.651534,47.404891,9.650349,47.413723,9.645052,47.437759,9.658573,47.448315,9.659791,47.45354,9.63936,47.456354,9.622476,47.457694,9.61455,47.466452,9.610175,47.471141,9.604278,47.462726,9.601076,47.461677,9.595305,47.463283,9.591438,47.468272,9.587253,47.475338,9.584177,47.48037,9.577299,47.485187,9.562295,47.496429,9.563084,47.506064,9.611954,47.529369,9.593261,47.570712,9.56701,47.579303,9.549311,47.582256))
thx - Juppo

Similar Messages

  • SDO_GEOM.SDO_BUFFER failed with ORA-13050

    Hello,
    I want to construct buffer for polylines.
    SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT function returns TRUE for problem geometries:
    SELECT SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT(
    MDSYS.SDO_GEOMETRY(2002, NULL, NULL, MDSYS.SDO_ELEM_INFO_ARRAY(1, 2, 1), MDSYS.S
    121.75439, 31.37049, 121.75234, 31.36996, 121.75245, 31.37184, 121.75262, 31.373
    121.75232, 31.37518, 121.74977, 31.37854)), 1e-7)
    from dual
    SDO_GEOM.VALIDATE_GEOMETRY_WIT
    TRUE
    But SDO_BUFFER fails:
    SELECT SDO_GEOM.SDO_BUFFER(
    MDSYS.SDO_GEOMETRY(2002, NULL, NULL, MDSYS.SDO_ELEM_INFO_ARRAY(1, 2, 1), MDSYS.SDO_ORDINATE_ARRAY(
    121.75439, 31.37049, 121.75234, 31.36996, 121.75245, 31.37184, 121.75262, 31.37362, 121.75253, 31.37449,
    121.75232, 31.37518, 121.74977, 31.37854)), 1e-5, 1e-7)
    from dual;
    Can somebody help me with advice how to construct buffer?
    I have SDO_VERSION=9.2.0.5.0
    Data tolerance in the user_sdo_geom_metadata table is 1e-7.
    Thank you.
    PS:
    Other example of problem polyline:
    MDSYS.SDO_GEOMETRY(2002, NULL, NULL, MDSYS.SDO_ELEM_INFO_ARRAY(1, 2, 1), MDSYS.SDO_ORDINATE_ARRAY(
    121.68669, 31.3819, 121.68675, 31.3822, 121.68665, 31.38219, 121.68668, 31.3824,
    121.6867, 31.38242, 121.68676, 31.38241, 121.68679, 31.38254, 121.68682, 31.38254, 121.6868, 31.3824))

    Hello.
    I’m still trying to find out resolution for buffers construction :)
    Actually I've got that buffer construction works much better on geodesic data.
    Next statement is OK now:
    SELECT SDO_GEOM.SDO_BUFFER(
    MDSYS.SDO_GEOMETRY(2002, 8307, NULL, MDSYS.SDO_ELEM_INFO_ARRAY(1, 2, 1), MDSYS.SDO_ORDINATE_ARRAY(
    121.75439, 31.37049, 121.75234, 31.36996, 121.75245, 31.37184, 121.75262, 31.37362, 121.75253, 31.37449,
    121.75232, 31.37518, 121.74977, 31.37854)), 1, 1e-2, 'arc_tolerance=0.5')
    from dual;
    I run large test and got only one (currently) issue with the next poliline [ORA-13050: unable to construct spatial object]:
    select SDO_GEOM.SDO_BUFFER(
    MDSYS.SDO_GEOMETRY(2002, 8307, NULL, MDSYS.SDO_ELEM_INFO_ARRAY(1, 2, 1), MDSYS.SDO_ORDINATE_ARRAY(
    117.56163, 23.74977999, 117.56163, 23.74949001, 117.56163, 23.7492, 117.56117999, 23.74906)),
    1, 1e-2, 'arc_tolerance=0.5') from dual;
    What is wrong with that poliline?
    Are there any rules or workarounds for such cases? Can some body suggest me something about that?
    I've found only 2 workarounds for that time:
    1) I need to construct buffer within 1 millimeter tolerance. So I can round input geometry ordinates to 1 millimeter (1e-7) and try to build buffer after that. I did it for above poliline - and it works (actually it is necessary to round only second ordinate 23.74977999->23.7497799). But I don't sure that it will resolve issue entirely.
    2) I can iteratively slightly increase buffer distance until buffer construction will be OK. Above example works starting from 1.3 meter. It is not best resolution because it can alter process logic.
    Thank you.

  • A bizarre ORA-13349 case in 9i

    Hi all,
    We have just migrated from 8.17 to 9.2 and encountered a rather strange validation error on a particular polygon geometry.
    Subject Geometry:
    Parcel polygon composed of 4 polylines and 3 arcs.
    Validation SQL:
    SELECT SDO_GEOM.VALIDATE_GEOMETRY(SPATIALAREA, mtolerance) FROM PARCEL835105;
    Error:
    ORA-13349 (polygon boundary crosses itself) ONLY occurs when mtolerance is between 0.05 and 0.009. The geometry is considered fine when mtolerance is above 0.06 or below 0.008
    Observation:
    We examined the polygon using GeoMedia tool by traversing its vertices and could not find any apparent error.
    If you want to try the geometry you may create the following files by cutting-&-pasting the content underneath each file heading. Then run at the system prompt (DOS) IMPORT.BAT usr/pass@connectionstring.
    Bo Guo
    Maricopa County Assessor's Office
    Phoenix, AZ
    602-506-0930
    **************** PARCEL835105.DAT ********
    1525|2003| |pt||||1|1005|7|1|2|1|5|2|2|9|2|2|13|2|1|15|2|2|19|2|1|21|2|1|;658946.23100000003|870467.35999999999|658884.96200000006|870464.85400000005|658829.65517262102|870462.59209484397|658778.28773826023|870459.781195155|658727.01800000004|870455.54700000002|658692.40116387932|870451.87949395797|658657.85900000005|870447.56499999994|658657.79700328002|870442.51112167106|658743.64884854865|870452.05702360102|658829.85199999996|870457.59600000002|658941.16799999995|870462.14899999998|658946.23100000003|870467.35999999999|:||||
    **************** PARCEL835105.PRE ********
    CREATE TABLE PARCEL835105 (
    ID NUMBER(10,0),
    SPATIALAREA MDSYS.SDO_GEOMETRY,
    APN VARCHAR2(12),
    FLOOR NUMBER(10,0),
    DGN VARCHAR2(12),
    SOURCE_CD VARCHAR2(2), primary key (ID) );
    Exit;
    **************** PARCEL835105.POS ********
    insert into USER_SDO_GEOM_METADATA values('PARCEL835105', 'SPATIALAREA' ,MDSYS.SDO_DIM_ARRAY( MDSYS.SDO_DIM_ELEMENT('X', 232850, 993600, 0.03), MDSYS.SDO_DIM_ELEMENT('Y', 526000, 1134000, 0.03)), NULL );
    Commit;
    Exit;
    **************** PARCEL835105.CTL ********
    LOAD DATA
    INFILE 'PARCEL835105.Dat'
    APPEND INTO TABLE PARCEL835105
    FIELDS TERMINATED BY '|' OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    ID,
    SPATIALAREA COLUMN OBJECT
    ( sdo_gtype INTEGER EXTERNAL,
    sdo_srid INTEGER EXTERNAL,
    isnull FILLER CHAR,
    SDO_POINT COLUMN OBJECT NULLIF SPATIALAREA.isnull="pt"
    ( X INTEGER EXTERNAL,
    Y INTEGER EXTERNAL,
    Z INTEGER EXTERNAL),
    SDO_ELEM_INFO VARRAY terminated by ';'
    (SDO_ORDINATES char(38)),
    SDO_ORDINATES VARRAY terminated by ':'
    (SDO_ORDINATES char(38))) ,
    APN,
    FLOOR,
    DGN,
    SOURCE_CD )
    **************** IMPORT.BAT********
    @echo off
    REM Copyright (c) 1999-2002 by Intergraph Corporation. All Rights Reserved.
    Rem Use this script to create tables and metadata with PL/SQL and populate tables with SQL*Loader.
    if "%1"=="" goto usage
    SQLPLUS %1 @"PARCEL835105.PRE"
    SQLLDR %1 CONTROL= PARCEL835105
    SQLPLUS %1 @"PARCEL835105.POS"
    goto end
    : usage
    @echo Syntax of the command is: "Import <username>/<password>@<ConnectString>"
    echo Examples:
    echo Import scott/tiger@db_orcl
    : end
    pause

    Doc ID: Note:1020247.102,Subject: Validating Geometry Returns ORA-13349 or ORA-13356 [published @ metalink]
    Problem Description:
    ====================
    Validating geometries for polygons in the Spatial Data Cartridge, may give: ORA-13349: polygon boundary crosses itself or ORA-13356 adjacent points in a geometry are redundant However, examining the polygon data shows that there are no crossing lines and no redundant points. This error may also be raised by SDO_BUFFER, which will appear to create an invalid polygon. Solution
    Description:
    =====================
    This is caused by the SDO_TOLERANCE being set to an inappropriate value for the data in the layer. The tolerance will be taken into account when validating whether two points are the same or if two lines cross.
    Explanation:
    ============
    SDO_VALIDATE_GEOMETRY generates an ORA-13349 when it detects that the geometric properties of the data are incorrect, and that the shape crosses itself. The reason for the errors is that the buffer function sometimes needs to generate very small shapes, typically circular arcs. There are situations where the ordinates generated have a precision higher than the SDO_TOLERANCE setting. Once rounded using the SDO_TOLERANCE setting, then it is possible that the shape appears to cross itself (ORA-13349). Setting the tolerance to 0.0 will remove the errors, since rounding will no longer happen. An simple example is if there are two points on the polygon: 2.60, 3.00 and 2.56, 3.00 with the tolerance set to .05 When rounded these will both appear to be 2.6, 3.00 and give the ORA-13356 error. Setting the tolerance to .005 would avoid this error. For SDO_BUFFER this error should not be reported from 8.1.6 onwards.

  • SDO_RELATE and SDO_BUFFER

    Hi Folks,
    I created a generic stored procedure that gets a table and a polygon coordinates as parameters and returns
    the table records that satisfy a relationship.
    One example of fhe SQL executed by the procedure is:
    select GEOFT_MESORREGIAO.* from GEOFT_MESORREGIAO
    where SDO_RELATE(GEOFT_MESORREGIAO.MES_GM_POLIGONO,
    SDO_GEOMETRY(2003,2000004,NULL,
    SDO_ELEM_INFO_ARRAY(1,1003,1),
    SDO_ORDINATE_ARRAY(-51.427259,-20.547785,-51.575114,-22.289193,-49.094429,-22.387763,-49.028716,-20.457420)),'mask=ANYINTERACT') ='TRUE'
    The GEOFT_MESORREGIAO stores polygon geometries.
    Running the example I got 7 rows as result.
    In the same procedure, users can pass additional parameters to create a buffer around the polygon defined as the query window.
    In this case, the SQL executed is:
    select GEOFT_MESORREGIAO.* from GEOFT_MESORREGIAO
    where SDO_RELATE(GEOFT_MESORREGIAO.MES_GM_POLIGONO,
    SDO_GEOM.SDO_BUFFER(SDO_GEOMETRY(2003,2000004,NULL,
    SDO_ELEM_INFO_ARRAY(1,1003,1),
    SDO_ORDINATE_ARRAY(-51.427259,-20.547785,-51.575114,-22.289193,-49.094429,-22.387763,-49.028716,-20.457420)),10,0.05,'unit=KM'),'mask=ANYINTERACT') ='TRUE'
    Running this example I got 6 rows as result.
    This is not right to me, because if I'm using a bigger query window created by the buffer function, it was expected to get more rows
    as result or, at least, the same number of rows returned by the first example.
    This was tested in Oracle 11g R1.
    Am I missing anything?
    Regards,
    Luis

    Hi
    When validating your inline geometry, it returns a ORA-13348: polygon boundary is not closed.
    The first coordinate should be repeated at the end to close a ring in a polygon.
    SDO_GEOMETRY(2003,8236,NULL,
    SDO_ELEM_INFO_ARRAY(1,1003,1),
    SDO_ORDINATE_ARRAY(-51.427259,-20.547785,-51.575114,-22.289193,-49.094429,-22.387763,-49.028716,-20.457420*,-51.427259,-20.547785*))
    will validate.
    Try it and see if your results are as expected.
    Luc

  • SDO_BUFFER & multlinestring

    Hi!
    I am trying to create a buffer around the I 10 Highway from the US-dataset, interstates table. I am using following statement:
    select sdo_geom.sdo_buffer((select geom from interstates where highway = 'I 10'), 0.5 , 0.1) from dual;
    which results into:
    [1]: (Error): ORA-13050: unable to construct spatial object
    ORA-06512: at "MDSYS.SDO_3GL", line 399
    ORA-06512: at "MDSYS.SDO_GEOM", line 3228 ORA-06512: at "MDSYS.SDO_GEOM", line 3240 ORA-06512: at line 1
    The I 10 is a multiline so I also tried to create a buffer arround the I 170 and this works perfectly. Therfore I tried to create a buffer around several other highways, all of them were multilines and they all failed.
    what a I doing wrong? Or is it impossible to create a buffer around a multiline string?
    null

    I found that the following statement does work for me:
    select sdo_geom.sdo_buffer(geom, (select diminfo
    from user_sdo_geom_metadata
    where table_name = 'INTERSTATES'
    and column_name = 'GEOM'), 0.5)
    from interstates where highway = 'I 10';
    But I don't understand what is wrong with the first statement.

  • Help -  Error -13282: ORA-13282:

    Error -13282: ORA-13282: failure on initialization of coordinate transformation
    Getting this error when trying to Insert some spatial data. Totally new to spatial data processing. Had to look at this after the original developer quit the company.
    Here is the Insert statment
    INSERT INTO table1 VALUES(seq.NextVal, t_rec.ID, 0, 'CompanyABCD', SDO_GEOM.SDO_BUFFER(p_geod, 100, 0.5,'unit=foot'), SDO_GEOM.SDO_BUFFER(p_proj, 100, 0.5,'unit=foot'));
    P_geod and p_proj values were derived earlier..
    p_geod := MDSYS.SDO_GEOMETRY(2001, 8265, MDSYS.SDO_POINT_TYPE(lon,lat,NULL), NULL, NULL);
    p_proj := sdo_cs.transform(p_geod, 9990001);
    and here is the table structure
    ID NUMBER(11) NOT NULL,
    TICKET_ID NUMBER(11) NOT NULL,
    REVISION NUMBER(11) NOT NULL,
    COMPANY VARCHAR2(30 BYTE),
    EXTENT_GEOD MDSYS.SDO_GEOMETRY,
    EXTENT_PROJ MDSYS.SDO_GEOMETRY
    I also ran this
    select sdo_cs.validate_wkt(9990001) from dual
    and received this error
    ORA-13249: SRID 9990001 does not exist in MDSYS.CS_SRS table
    ORA-29400: data cartridge error
    Error - OCI_NODATA
    ORA-06512: at "MDSYS.SDO_CS", line 452
    Greatly appreciate your help..

    Thanks for the reply. Sorry I was out of town for a couple of weeks and this issue is still out there pending.
    What's the procedure for defining a non-standard coordinate system number? Does it have to be done by the DBA or a developer could do it himself?
    Thanks in advance

  • Error ORA-00907 with query  SDO_GEOM.SDO_DIFFERENCE

    Hi,
    I have following query:
    SELECT SDO_GEOM.SDO_DIFFERENCE(
    SDO_RELATE(square.geometry, SDO_GEOM.SDO_BUFFER(MDSYS.SDO_GEOMETRY(3001, 1, MDSYS.SDO_POINT_TYPE(424, 1272, 0) , NULL, NULL), 100, 0.05,'unit=m arc_tolerance=0.005'), 'mask=ANYINTERACT querytype=WINDOW') = 'TRUE',
    SDO_RELATE(square.geometry, SDO_GEOM.SDO_BUFFER(MDSYS.SDO_GEOMETRY(3001, 1, MDSYS.SDO_POINT_TYPE(276, 1274, 0) , NULL, NULL), 100, 0.05,'unit=m arc_tolerance=0.005'), 'mask=ANYINTERACT querytype=WINDOW') = 'TRUE',
    0.001
    Always get the ora-00907: a bracket is missing-error.
    Any help is really appreciated. Is there a error in the query?
    Regards Ronald.

    Hi Ronald,
    try following:
    SELECT SDO_GEOM.SDO_DIFFERENCE(
        SELECT square.geometry from square where
          SDO_RELATE (square.geometry, SDO_GEOM.SDO_BUFFER(
              MDSYS.SDO_GEOMETRY(
                3001, 1, MDSYS.SDO_POINT_TYPE(424, 1272, 0) , NULL, NULL
              ), 100, 0.05,'unit=m arc_tolerance=0.005'
            ), 'mask=ANYINTERACT querytype=WINDOW'
          ) = 'TRUE'
        SELECT square.geometry from square where
          SDO_RELATE (square.geometry, SDO_GEOM.SDO_BUFFER(
              MDSYS.SDO_GEOMETRY(
                3001, 1, MDSYS.SDO_POINT_TYPE(276, 1274, 0) , NULL, NULL
              ), 100, 0.05,'unit=m arc_tolerance=0.005'
            ), 'mask=ANYINTERACT querytype=WINDOW'
          ) = 'TRUE'
        0.001   
    FROM DUAL   

  • Sdo_buffer question

    I am hoping that someone can help me. I know this is a super easy fix. I am looking to creat a buffer around one xy coord. Am I on the right tract.
    select sdo_geom.sdo_buffer(MDSYS.SDO_GEOMETRY(2001,8307,MDSYS.SDO_POINT_TYPE(2560808.6,387514.844,0),NULL,NULL), m.diminfo,100,.0005)
    from tractblockpoint2000 t, user_sdo_geom_metadata m
    select sdo_geom.sdo_buffer(MDSYS.SDO_GEOMETRY(2001,8307,MDSYS.SDO_POINT_TYPE(2560808.6,387514.844,0)
    ERROR at line 1:
    ORA-13205: internal error while parsing spatial parameters
    ORA-06512: at "MDSYS.SDO_3GL", line 439
    ORA-06512: at "MDSYS.SDO_GEOM", line 3065

    The answer is yes. It is easy to buffer a point.
    There are more questions to ask and answer here, though, because your data is not valid.
    your sdo_gtype = 2301: this is not allowed. If I was to guess from looking at your data, I would guess you want 2001.
    your sdo_srid = 8307: this is fine if your coordinates are between -180 and 180 in longitude (x), and -90 to 90 in latitude (y). Your data is not in this range.
    if I was writing this, i would use the sdo_point_type instead of sdo_elem_info_array and sdo_ordinate array.
    A two-d point in the sdo_ordinate_array should only have 2 ordinates (x and y, not x,y,null) - if stored in the sdo_point_type, then you need x, y, and null.
    you don't need a select ... from dual to buffer the geometry, you can call the function in the operator.
    Arc tolerance of 1/2 meter (0.5) is very fine - you will get a geometry with lots of vertices, and it may take a long time to get results. Below is an example of your query, rewritten, with a 10 meter tolerance. That said, further below is the same query written as sdo_within_distance, which includes an implicit, highly accurate buffer operation and an anyinteract.
    Note since these queries are in a geodetic coordinate system and you didn't specify units, the default is meters.
    The rewritten queries use the geod_cities table which is downloadable from OTN ( http://otn.oracle.com/products/spatial ), click on training on the right, then exercise solutions.
    Your query rewritten:
    select city
    from geod_cities t
    where sdo_relate(t.location, sdo_geom.sdo_buffer( mdsys.SDO_GEOMETRY(2001,8307, sdo_point_type(-75.13,40,NULL),null,null), 1000, 0.05, 'arc_tolerance=10'), 'mask = anyinteract querytype=window') = 'TRUE';
    But best done using sdo_within_distance:
    select city
    from geod_cities t
    where sdo_within_distance(t.location, mdsys.SDO_GEOMETRY(2001,8307, sdo_point_type(-75.13,40,NULL),null,null), 'distance=1000') = 'TRUE';

  • PL/SQL report errors: ORA-01422

    Hi all,
    (before i you read i would like to say i have searched the net for this error code but nothing shows up like this problem..)
    I am getting an error problem when i select certain Schemas from a list on an apex app. page, it only works for some schemas not all..
    When i select one schema, it is supposed to display one row.. when i select [ALL] it is supposed to show them all.
    It does work if i select '[ALL]' from the select list (p3_schema_name), just not for every single individual one.
    the error code:
    ORA-01422: exact fetch returns more than requested number of rows
    declare
      vSchema  varchar2(20);
      vStmt  varchar2(1000);
      vVersion number(5);
      vDBName  varchar2(20);
      vHostName varchar2(80);
      vStmt2  varchar2(1000);
      vVersion2 number(5);
      vDBName2  varchar2(20);
      vServer2 varchar2(80);
      vSchema2 varchar2(80);
      CURSOR c_schemas IS
        select owner from dba_tables@P3_DB_NAME.db_link where table_name = 'DDL_LOG' and num_rows > 0 order by owner;
    begin
      IF :P3_SCHEMA_NAME != '[ALL]' AND :P3_DB_NAME IS NOT NULL AND :P3_SERVER_NAME IS NOT NULL THEN
        vServer2 := :P3_SERVER_NAME;
        vSchema2 := :P3_SCHEMA_NAME;
          vStmt2 := 'select distinct DDH_DB_NM, max(DDH_SCHEMA_NR)keep(dense_rank last order by ddh_runstart_td) AS "PATCH" from &P3_SCHEMA_NAME..ddl_log@&P3_DB_NAME.db_link GROUP BY DDH_DB_NM';
          Execute Immediate vStmt2 into vDBName2, vVersion2;
            htp.p('<br>');
            htp.p('<table border="1">');
            htp.p('<tr>');
            htp.p('<th bgcolor="#FFCC99">SERVER NAME</th>');
            htp.p('<th bgcolor="#FFCC99">DB NAME</th>');
            htp.p('<th bgcolor="#FFCC99">SCHEMA NAME</th>');
            htp.p('<th bgcolor="#FFCC99">PATCH</th>');
            htp.p('</tr>');
            htp.p('<tr>');
            htp.p('<td>');
            htp.p(vServer2);
            htp.p('</td>');
            htp.p('<td>');
            htp.p(vDBName2);
            htp.p('</td>');
            htp.p('<td>');
            htp.p(vSchema2);
            htp.p('</td>');
            htp.p('<td>');
            htp.p(vVersion2);
            htp.p('</td>');
            htp.p('<td>');
            htp.p('<BR>');
            htp.p('</td>');
            htp.p('</tr>');
            htp.p('</tr>');
            htp.p('</table>');
       ELSE IF :P3_SCHEMA_NAME = '[ALL]' AND :P3_DB_NAME IS NOT NULL AND :P3_SERVER_NAME IS NOT NULL THEN
       vHostName := :P3_SERVER_NAME;
       vDBName := :P3_DB_NAME;
         open c_schemas;
          htp.p('<br>');
          htp.p('<table border="1">');
          htp.p('<tr>');
          htp.p('<th bgcolor="#FFCC99">SERVER NAME</th>');
          htp.p('<th bgcolor="#FFCC99">DB NAME</th>');
          htp.p('<th bgcolor="#FFCC99">SCHEMA NAME</th>');
          htp.p('<th bgcolor="#FFCC99">PATCH</th>');
          htp.p('</tr>');
        LOOP
          FETCH c_schemas INTO vSchema;
          EXIT WHEN c_schemas%NOTFOUND;
          vStmt  := 'select max(DDH_SCHEMA_NR)keep(dense_rank last order by ddh_runstart_td) AS "PATCH" from '||vSchema||'.ddl_log@&P3_DB_NAME.db_link where DDH_SCHEMA_NR = (select max(DDH_SCHEMA_NR) from '||vSchema||'.ddl_log@&P3_DB_NAME.db_link) and rownum < 2' ;
          Execute Immediate vStmt into vVersion  ;
          htp.p('<tr>');
          htp.p('<td>');
          htp.p(vHostName);
          htp.p('</td>');
          htp.p('<td>');
          htp.p(vDBName);
          htp.p('</td>');
          htp.p('<td>');
          htp.p(vSchema);
          htp.p('</td>');
          htp.p('<td>');
          htp.p(vVersion);
          htp.p('</td>');
          htp.p('<td>');
          htp.p('<BR>');
          htp.p('</td>');
          htp.p('</tr>');
        END LOOP;
          htp.p('</tr>');
          htp.p('</table>');  
      CLOSE c_schemas;
    END IF;
    END IF;
    END;I have checked the DDH_SCHEMA_NR for repeating entries of the highest number.. some of the ones that dont work do have repeating entries some don't.
    Sorry if this is confusing, i have tried to explain it as best as i can.
    Thanks in advance for any help.
    Ashleigh

    Hello Ashleigh,
    Based on your code, I'd start by running this piece of SQL via command-line (thru SQL Workshop, SQL*Plus, Toad, etc.), replacing &P3_SCHEMA_NAME. and &P3_DB_NAME. with values that are currently causing the routine to fail and see if it returns more than one row. I don't know your data, but DISTINCT and GROUP BY are typically used to return multiple (though grouped/summarized) rows. It appears to be the only statement that would cause the error your seeing (more than one row being returned into single variables).
    select distinct DDH_DB_NM, max(DDH_SCHEMA_NR)keep(dense_rank last order by ddh_runstart_td) AS "PATCH" from &P3_SCHEMA_NAME..ddl_log@&P3_DB_NAME.db_link GROUP BY DDH_DB_NM;I'm actually surprised that the code runs at all. I didn't think 'execute immediate' would know what to do with substitutions indicated as "&something." (I've typically seen that when substituting in dynamic HTML/Javascript code but maybe I'm learning something new). But since you already have vServer2 and vSchema2, I'd be more apt to code it as:
    vStmt2 := 'select distinct DDH_DB_NM, max(DDH_SCHEMA_NR)keep(dense_rank last order by ddh_runstart_td) AS "PATCH" from ' ||
    vSchema2 || '.ddl_log@' || vServer2 || '.db_link GROUP BY DDH_DB_NM';Hope this helps,
    John

  • Ora-00604 error and ora 01000 error while report generation.

    hi all,
    I am trying to generate the multiple reports of same template through a program.
    While this job is running, i get the following error at the BIP console and the reports don't get generated.
    [101711_044115578][][EXCEPTION] java.sql.SQLException: ORA-00604: error occurred
    at recursive SQL level 1
    ORA-01000: maximum open cursors exceeded
    ORA-00604: error occurred at recursive SQL level 1
    ORA-01000: maximum open cursors exceeded
    ORA-01000: maximum open cursors exceeded
    Kindly help.
    Thanks.

    Lots of resources with a simple search to see what this is about, for example:
    http://www.orafaq.com/wiki/ORA-01000
    ORA-01000:     maximum open cursors exceeded
    Cause:     A host language program attempted to open too many cursors. The initialization parameter OPEN_CURSORS determines the maximum number of cursors per user.
    Action:     Modify the program to use fewer cursors. If this error occurs often, shut down Oracle, increase the value of OPEN_CURSORS, and then restart Oracle.
    open_cursors parameter
    http://download.oracle.com/docs/cd/E11882_01/server.112/e25513/initparams160.htm#REFRN10137
    Oracle support note:
    OERR: ORA-1000 maximum open cursors exceeded (Doc ID 18591.1)

  • EA2: ORA-01427 clicking on a view in the navigator

    SQLDev: 1.5.0.52.03
    Java: 1.6.0_04
    Oracle: 9.2.0.7.0
    I'm getting the following error when I click on a view in the navigator pane:
    An error was encountered performing the requested operation:
    ORA-01427: single-row subquery returns more than one row 01427. 00000 - "single-row subquery returns more than one row"I'm not seeing any errors in the shell window.
    After clicking on <OK> in the error dialog, the normal tabs (Columns, Data, Grants, Dependencies, Details, SQL) are displayed, but there is no content in the Columns tab.
    All the other tabs seem to function normally.
    Here is the DDL from the SQL tab
    CREATE OR REPLACE VIEW "SUBSCRIPTIONS"
        "ORDER_ID", "SUNBURST_ORDER_ID", "SIEBEL_ORDER_ID", "ACCOUNT_ID",
        "COMP_ID", "SUBACCOUNT_ID", "START_DATE", "END_DATE", "PULL_DATE",
        "SUBSCRIPTION_TYPE", "PRICE_CLASS", "DESCRIPTION", "SEAT_COUNT",
        "ORDER_DURATION", "CALLBACK_INTERVAL", "UPDATE_DATE", "UPDATE_USERNAME",
        "AFFILIATE"
    AS
        SELECT order_id,
            sunburst_order_id,
            siebel_order_id,
            account_id,
            comp_id,
            subaccount_id,
            start_date,
            end_date,
            pull_date,
            product_id,
            price_class,
            product_name,
            add_users,
            order_duration,
            callback_interval,
            last_mdfy_date,
            last_mdfy_emp,
            affiliate
        FROM csbcrossworlds.subscriptions;We have 15 views in this schema, 3 of them fail this way but the other 12 display the columns just fine. So far I am unable to detect any commonality.
    Any ideas?

    Ok, I think I found the problem. The view in question (SUBSCRIPTIONS) is owned by 'PHILC' and it references a table named 'SUBSCRIPTIONS' owned by 'CSBCROSSWORLDS'. There are two other development schemas that also own tables named 'SUBSCRIPTIONS'.
    I believe the 'Columns' tab is executing the query below. The subquery in this SQL tries to identify the primary key columns for the 'SUBSCRIPTIONS' view in my schema (PHILC):
    SELECT
        c.column_name,
        DECODE(
            data_type,
                'CHAR',      data_type||'('||c.data_length||')',
                'VARCHAR',   data_type||'('||c.data_length||')',
                'VARCHAR2',  data_type||'('||c.data_length||')',
                'NCHAR'   ,  data_type||'('||c.data_length||')',
                'NUMBER'  ,  DECODE(c.data_precision,null,'NUMBER', data_type||'('||c.data_precision||','||c.data_SCALE||')'),
                'NVARCHAR',  data_type||'('||c.data_length||')',
                'NVARCHAR2', data_type||'('||c.data_length||')',
                data_type) data_type,
        DECODE(nullable, 'Y', 'Yes', 'No') nullable,
        c.DATA_DEFAULT,
        column_id,
        com.comments,
        (SELECT 1 FROM all_constraints, all_cons_columns
          WHERE all_constraints.constraint_type = 'P' AND
                all_constraints.constraint_name = all_cons_columns.constraint_name AND
                all_constraints.owner = all_cons_columns.owner AND
                all_cons_columns.table_name = c.table_name AND
                c.column_name = all_cons_columns.column_name) Primary_Key,
        c_update.insertable,
        c_update.updatable,
        c_update.deletable
    FROM
        sys.all_tab_Columns c, sys.all_col_comments com, sys.user_updatable_columns c_update
    WHERE
        c.owner = :OBJECT_OWNER AND
        c.table_name = :OBJECT_NAME AND
        c.table_name = com.table_name AND
        c.owner = com.owner AND
        c.column_name = com.column_name AND
        c_update.column_name = com.column_name AND
        c_update.table_name = com.table_name
    ;Extracting the subquery into this:
    SELECT
        all_constraints.owner,
        all_constraints.table_name,
        all_constraints.constraint_name
    FROM all_constraints, all_cons_columns
    WHERE
        all_constraints.constraint_type = 'P' AND
        all_constraints.constraint_name = all_cons_columns.constraint_name AND
        all_constraints.owner = all_cons_columns.owner and
        all_cons_columns.table_name = 'SUBSCRIPTIONS' and
        'ORDER_ID' = all_cons_columns.column_name;I got this output:
       owner          table_name      constraint_name
    CUTOVER          SUBSCRIPTIONS    SUBSCRIPTIONS_PK
    CROSSWORLDS      SUBSCRIPTIONS    SUBSCRIPTIONS_PK
    CSBCROSSWORLDS   SUBSCRIPTIONS    SUBSCRIPTIONS_PKLooking at the DDL for the view, the row we really want is for owner 'CSBCROSSWORLDS'. Unfortunately, that means having to somehow parse the SQL text to extract the owner name...
    Phil

  • Using database-link in view to get around ORA-01031 error

    I have been granted select rights on a users table. I am therefore able to select from his table. If however I try create a view against his table I run into the ORA-01031 problem. I have worked around this problem by creating a database-link to myself and then adding that to the view creation and it works. What are the downsides of using the database-link in this way?

    The only down side I have been able to identify is that a extra session is created and that the CPU has a little extra work due to the LOOP BACK that takes place. I need to ensure the network is not unnessesarly used and therefore will need to ensure that 127.0.0.1 (local host) is used in the database connection discription. e.g.
    create database link my_db_link connect to scott identified by tiger using '(description=(address=(protocol=tcp)(host=127.0.0.1) (Port = 1521) ) (connect_data= (sid=ora10g)))';

  • Getting ora:00904 invalid indentifier error while running i query

    Hi,
    I have a remote database and local database both are oracle 10gR2.Now i have written the below mentioned query in my local database and is working fine,but in case remote database it is throughing error ora:00904 invalid indentifier.
    I had export the dump from remote db and import it on my local db and i tried the same and it is working fine on local after that also.
    As i believe that this error usually come for column name not exist or column name or it's length or for any special character in column name of the table.But as i said it is working fine on local db but not in remote db though i am using the same dump for local and remote.
    Though when i am querying the table i can able to fetch data for the any record but when i am using the below mentioned query for the same i am getting the error.As i am doing this to fecth the data for child parent related relationship.
    Can any one suggest is there anything related to configaration or something else.
    Please do let me know if you do want some more information on the query what i am doing inside of it.
    Rgds,
    Anit
    Edited by: Anit A. on Sep 1, 2008 2:32 AM
    Edited by: Anit A. on Sep 1, 2008 2:33 AM

    WITH t
    AS
    SELECT decode(t.spnlevel
    ,3,t.u_quotesdtlid
    ,2,decode((select count(*)
    from u_quotesdtl t2
    where t2.u_quotesdtlid = t.u_quotesdtlid
    and t2.parentspn = (t2.jobgroupid||':'||t2.jobtype)
    ),0,(select t1.u_quotesdtlid
    from u_quotesdtl t1
    where t1.spnitemcode = t.parentspn
    and t1.spnlevel = '3'
    and t1.jobtype = t.jobtype
    and t1.jobgroupid = t.jobgroupid
    and t1.QUOTEID = t.QUOTEID
    ),t.u_quotesdtlid
    ,1,decode((select count(*)
    from u_quotesdtl t2
    where t2.QUOTEID = t.QUOTEID
    and t2.parentspn = (t2.jobgroupid||':'||t2.jobtype)
    ),0,t.u_quotesdtlid,decode((select count(*)
    from u_quotesdtl t3
    where t3.QUOTEID = t.QUOTEID
    and t3.parentspn = (t3.jobgroupid||':'||t3.jobtype)
    and t3.u_quotesdtlid in (select t1.u_quotesdtlid
    from u_quotesdtl t1
    where t1.spnitemcode = t.parentspn
    and t1.spnlevel = '2'
    and t1.jobtype = t.jobtype
    and t1.jobgroupid = t.jobgroupid
    and t1.QUOTEID = t.QUOTEID
    ),0,(select t4.u_quotesdtlid
    from u_quotesdtl t4
    ,(select t1.parentspn
    ,t1.jobtype
    ,t1.jobgroupid
    from u_quotesdtl t1
    where t1.spnitemcode = t.parentspn
    and t1.spnlevel = '2'
    and t1.jobtype = t.jobtype
    and t1.jobgroupid = t.jobgroupid
    and t1.QUOTEID = t.QUOTEID
    ) t5
    where t4.spnitemcode = t5.parentspn
    and t4.spnlevel = '3'
    and t4.jobtype = t5.jobtype
    and t4.jobgroupid = t5.jobgroupid
    and t4.QUOTEID = t.QUOTEID
    (select t1.u_quotesdtlid
    from u_quotesdtl t1
    where t1.spnitemcode = t.parentspn
    and t1.spnlevel = '2'
    and t1.jobtype = t.jobtype
    and t1.jobgroupid = t.jobgroupid
    and t1.QUOTEID = t.QUOTEID
    ,null,t.u_quotesdtlid) as parentquoteid
    ,t.u_quotesdtlid as quotesdtlid
    ,t.spnlevel as spnlevel
    FROM u_quotesdtl t
    WHERE t.QUOTEID ='som key id'
    ORDER BY parentquoteid,t.spnlevel desc
    select * from t;

  • 'ORA-01722: Invalid Number' error while Running a Query

    Hi,
    I'm trying to run a query built on a DSO. The DSO has a field 'Start Date'. This Start Date InfoObject has a reference Char as 0DATE.
    This Start Field has blank values due to which I'm getting the ORA-01722 error. I came across many threads with same topic of discussion. As mentioned in one of the Threads I have written a program to update 'Start Date' with 00000000. The code wriiten is "UPDATE /BIC/AZ_MONINV00 SET /BIC/ZSTR_DTE = '00000000' where /BIC/ZSTR_DTE = ' '.
    Now when I see the data in the active data table of DSO the blank value is replaced with '00000000'.
    But If I right click on the DSO click on display data the 'Start Date' field is blank. And now the Query also gets executed without any error. But in the output of the query the 'Start Date' Field has "#" values.
    Can anyone suggest on how can I make these "#" values appear as 00000000 in the report?

    In this case, you have to write a macro to avoid # in Analyzer.
    Right Click-->Display Data will show data from Active table of DSO only.
    If you don't want to show any blank date values in the report, you can exclude in Filter in Query.

  • ORA-12712 error while changing nls character set to AL32UTF8

    Hi,
    It is strongly recommend to use database character set AL32UTF8 when ever a database is going to used with our XML capabilities. The database character set in the installed DB is WE8MSWIN1252. For making use of XML DB features, I need to change it to AL32UTF8. But, when I try doing this, I'm getting ORA-12712: new character set must be a superset of old character set. Is there a way to solve this issue?
    Thanks in advance,
    Divya.

    Hi,
    a change from we8mswin1252 to al32utf8 is not directly possible. This is because al32utf is not a binary superset of we8mswin1252.
    There are 2 options:
    - use full export and import
    - Use of the Alter in a sort of restricted way
    The method you can choose depends on the characters in the database, is it only ASCII then the second one can work, in other cases the first one is needed.
    It is all described in the Support Note 260192.1, "Changing the NLS_CHARACTERSET to AL32UTF8 / UTF8 (Unicode)". Get it from the support/metalink site.
    You can also read the chapters about this issue in the Globalization Guide: [url http://download.oracle.com/docs/cd/E11882_01/server.112/e10729/ch11charsetmig.htm#g1011430]Change characterset.
    Herald ten Dam
    http://htendam.wordpress.com

Maybe you are looking for

  • How to run the same procedure in parallel for different parameter value.

    Hi There, I am currently working on extracting data in to flat file and I am able to do so for one revenue month (e.g. 200101) using PL/SQL procedure(get_rev_data). it takes almost 1 hour to execute the procedure completely and it generates 400 MB da

  • Create Smart Object /Frame Layer from open file in PSE8?

    I'm loving the trial version of PSE 8.  Several features that I don't want to live without! One thing that I find more difficult is creating a Smart Object or a Frame Layer (did those get replaced?) from an open file.  Because I digital scrapbook in

  • How to show icons startup manager

    Hi ! I'm gooing to try a multi boot hard drive. There is a Mac OS X 10.5 boot, a Mac OS X 10.6 boot, a Mac OS X 10.7 boot and an OS X 10.8 boot. For 10.5 and 10.6 Boot the volumes icons are showed, but not for 10.7 and 10.8. I have just do apple-c /

  • Adobe Application Manager doesn't work

    We have bought two licences of the Creative Suite, but only one of these is ok. For the second one, when the user accepts the invitation of administrator and starts the download of  adobe application manager, he can only download the trial version an

  • Video Icon missing. How do I get it back?

    My Iphone 3g used to have the icon "videos". It is gone now. How do I get it back? I have sync'd and restored right back to factory to see if I can get it back. It is the icon at the bottom betweem the "music" and "photos" icon. Cheers