SDO_RELATE does not return expected points

Hi,
I have a problem with a query which does not return the results I am expecting. I think it may be to do with geodetic data v projected data but fail to see how.
the table points2 contains point data stored in Lat Long (SRID 8307)
Here is my query:
SELECT mdsys.sdo_cs.transform(points2.assetextent,26943) FROM points2
WHERE SDO_RELATE (points2.ASSETEXTENT, MDSYS.SDO_GEOMETRY(2003,26943 ,NULL, mdsys.SDO_ELEM_INFO_ARRAY(1,1003,3), mdsys.SDO_ORDINATE_ARRAY(1831679.1743184,644380.053168771,1831699.1743184,645000.053168677)),'mask=anyinteract') = 'TRUE';
This query returns 0 results. if perform the same query with SDO_FILTER rather than SDO_RELATE then I get 1 result (which is what I expect). the result is this:
MDSYS.SDO_CS.TRANSFORM(POINTS2.ASSETEXTENT,26943)(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y, Z), SDO_ELEM_INFO, SDO_ORDINATES)
SDO_GEOMETRY(3001, 26943, NULL, SDO_ELEM_INFO_ARRAY(1, 1, 1), SDO_ORDINATE_ARRAY(1831689.17, 644440.053, 0))
1 row selected.
As can clearly be seen from this result the point is 10m from the both vertical edges of the optimised rectangle and at least 60m from the horizontal edges.
The sdo_geom_metadata_table entry for this table is:
SDO_OWNER SDO_TABLE_NAME
SDO_COLUMN_NAME
SDO_DIMINFO(SDO_DIMNAME, SDO_LB, SDO_UB, SDO_TOLERANCE)
SDO_SRID
VST POINTS2
ASSETEXTENT
SDO_DIM_ARRAY(SDO_DIM_ELEMENT('X', -180, 180, .005), SDO_DIM_ELEMENT('Y', -90, 90, .005), SDO_DIM_ELEMENT('Z', -999, 5000, .005))
8307
Anyone got any pointers? If you need more info just let me know
Sam

hi,
can you try this query and let us know what you get ?
Transform the geometry to 8307 and pass it into the sdo_relate
operator.
SELECT mdsys.sdo_cs.transform(points2.assetextent,26943) FROM points2
WHERE SDO_RELATE (points2.ASSETEXTENT,
sdo_cs.transform(MDSYS.SDO_GEOMETRY(2003,26943 ,NULL, mdsys.SDO_ELEM_INFO_ARRAY(1,1003,3), mdsys.SDO_ORDINATE_ARRAY(1831679.1743184,644380.053168771,
1831699.1743184,645000.053168677)), 8307), 'mask=anyinteract') = 'TRUE';

Similar Messages

  • Procedure Does not return expected new rows unless I ALTER the procedure it self

    Procedure Does not return expected new rows !!!   unless I ALTER the procedure it self

    And what exactly do you alter, the code / where clause / or ...?
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • Ctxrule - match does not return expected result

    v.11.1.07 - I have created a ctxrule index as detailed below. However, although a query should match on the given document, it does not return. Any ideas?
    begin
    ctx_ddl.create_preference('ot_lexer', 'basic_lexer');
    ctx_ddl.set_attribute('ot_lexer', 'index_stems', 'ENGLOSH');
    end;
    begin
    ctx_ddl.create_section_group('ot_sec_group', 'auto_section_group');
    end;
    create table ot_profile_test
    (profile_id number,
    query clob);
    create index ot_profile_rule_ndx on ot_profile_test(query)
    indextype is ctxsys.ctxrule parameters
    ('stoplist ctxsys.empty_stoplist
    section group ot_sec_group
    lexer ot_lexer');
    insert into ot_profile_test values(1, '($apple and $pear) and (1 within food)');
    commit;
    exec ctxsys.ctx_adm.set_parameter('log_directory', '/yourdir');
    exec ctx_output.start_log('ot');
    exec ctx_output.add_event(ctx_output.event_index_print_rowid);
    exec ctx_output.add_event(ctx_output.event_index_print_token);
    exec ctx_ddl.sync_index('ot_profile_rule_ndx', '2040M', null, 1, null, ctx_ddl.lock_nowait_error);
    exec ctx_output.end_log;Then, run a query:
    declare
    a clob := 'apple orange pears banana
    <metadata>
    <indicators>
       <food>1</food>
    </indicators>
    </metadata>
    vn_profile_id number;
    begin
    select profile_id into vn_profile_id
    from ot_profile_test
    where matches(query, a) > 0;
    dbms_output.put_line(vn_profile_id);
    end;
    ERROR at line 1:
    ORA-01403: no data found
    ORA-06512: at line 8Shouldn't profile_id = 1 be returned?
    Also, shouldn't the logfile have 2 rows written to $I?
    WRITING TOKEN APPLE:((PEAR) = (PEARS)) * ((1) WITHIN FOOD),0
    WRITING TOKEN APPLES:((PEAR) = (PEARS)) * ((1) WITHIN FOOD),0

    You need to use a basic_wordlist instead of a basic_lexer and ENGLISH instead of ENGLOSH in order to use stemming and your clob (variable a) must be valid html or xml in order to search within sections. Please see the simplified demonstration below.
    SCOTT@orcl_11gR2> begin
      2    ctx_ddl.create_preference ('ot_wordlist', 'basic_wordlist');
      3    ctx_ddl.set_attribute ('ot_wordlist', 'stemmer', 'ENGLISH');
      4    ctx_ddl.create_section_group ('ot_sec_group', 'auto_section_group');
      5  end;
      6  /
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11gR2> create table ot_profile_test
      2    (profile_id  number,
      3       query         clob)
      4  /
    Table created.
    SCOTT@orcl_11gR2> create index ot_profile_rule_ndx
      2  on ot_profile_test (query)
      3  indextype is ctxsys.ctxrule
      4  parameters
      5    ('stoplist     ctxsys.empty_stoplist
      6        wordlist     ot_wordlist
      7        section group     ot_sec_group')
      8  /
    Index created.
    SCOTT@orcl_11gR2> insert into ot_profile_test values
      2    (1, '($apple and $pear) and (1 within food)')
      3  /
    1 row created.
    SCOTT@orcl_11gR2> commit
      2  /
    Commit complete.
    SCOTT@orcl_11gR2> exec ctx_ddl.sync_index ('ot_profile_rule_ndx')
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11gR2> declare
      2    a clob :=
      3        '<table>
      4           <fruits>apple orange pears banana</fruits>
      5           <metadata>
      6             <indicators>
      7            <food>1</food>
      8             </indicators>
      9           </metadata>
    10         </table>';
    11  begin
    12    for r in
    13        (select profile_id
    14         from      ot_profile_test
    15         where  matches (query, a) > 0
    16         order  by profile_id)
    17    loop
    18        dbms_output.put_line (r.profile_id);
    19    end loop;
    20  end;
    21  /
    1
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11gR2>

  • SDO_Relate does not return an interior point

    When I use SDO_Relate to try to find a point contained within a polygon, I can only get any results if the point actually lies on a boundary - the interior point is not detected, even with an ANYINTERACT filter. Here's an example:
    create table test (id NUMBER(10), shape mdsys.sdo_geometry);
    INSERT INTO USER_SDO_GEOM_METADATA
    (TABLE_NAME,
    COLUMN_NAME,
    DIMINFO,
    SRID) VALUES('test',
    'shape',
    MDSYS.SDO_DIM_ARRAY(MDSYS.SDO_DIM_ELEMENT('LONG', -180.0, 180.0, 1), MDSYS.SDO_DIM_ELEMENT('LAT', -90.0, 90.0, 1)),
    8307);
    create index test_idx on test(shape) indextype is MDSYS.SPATIAL_INDEX;
    insert into test values (1, SDO_GEOMETRY(2003, 8307, NULL, SDO_ELEM_INFO_ARRAY(1, 1003, 1), SDO_ORDINATE_ARRAY(0,0, 0,-5, -5,-5, -5,0, 0,0)));
    SELECT id from test where SDO_RELATE(shape, SDO_GEOMETRY(2001, 8307, NULL, SDO_ELEM_INFO_ARRAY(1, 1, 1), SDO_ORDINATE_ARRAY(-2.5, -2.5)), 'mask=anyinteract') = 'TRUE';
    The above select statement returns no results...

    Hi Kent,
    In addition to fixing the data as Siva suggests, please see the following for more information regarding geodetic data:
    Re: problem with sdo_relate returning unexpected results
    Re: SDO_FILTER Bug in 10.2.0.1 and 10.1.0.2

  • Query for file version less than 10.0 does not return expected data

    I'm trying to build a query for all PCs that have a version of Iexplore.exe in c:\windows\program files\ that is less than 10.0 .  When I run the query it returns no data. When I change 10.0 in the query to 9.9 it returns files with version 10.xxx in
    the results.  Its as if it is seeing 10.0 as 1.0.   Is this expected ?
    select SMS_R_System.Name, SMS_R_System.ADSiteName, SMS_G_System_SoftwareFile.FileName, SMS_G_System_SoftwareFile.FileVersion from  SMS_R_System inner join SMS_G_System_SoftwareFile on SMS_G_System_SoftwareFile.ResourceID = SMS_R_System.ResourceId where
    SMS_G_System_SoftwareFile.FileName = "iexplore.exe" and SMS_G_System_SoftwareFile.FilePath = "C:\\program files\\internet explorer\\" and SMS_G_System_SoftwareFile.FileVersion < "9.9"

    It is because the values are not integer, they are a string. And therefore 1 is smaller then 9.
    http://www.enhansoft.com/

  • BAPI_ALM_ORDERHEAD_GET_LIST by CREATE_DATE does not return expected result.

    Hi,
    I am trying to retrieve an Order I have manually created on an ECC6.0 system with Order ID 816149.
    I can retrive the order fine using BAPI_ALM_ORDER_GET_DETAIL passig in the Order ID.
    However, if I use BAPI_ALM_ORDERHEAD_GET_LIST with IT_RANGE set on the ENTER_DATE criteria, I get a bunch of Orders back from the search but not mine. However, the creation date of my Order is within the search range. I suspect the problem might be the System Status of my order (but I am just guessing) which is CRTD MANC NMAT NTUP. The User Status is CRTD though, so I am a bit puzzled as to why my order is not in the returned result set. For instance Order 816148 (created by someone else) is returned and it looks very similar to mine (except for the status).
    If any help from SAP people, I am using an ICC Test system so maybe you can have a look for yourself. My system is CF5 / cpcf501 / 05 client 800.
    Cheers.
    JR

    Please pass
    Exporting
    DISPLAY_PARAMETERS
    CALL FUNCTION 'BAPI_ALM_ORDERHEAD_GET_LIST'
    EXPORTING
       DISPLAY_PARAMETERS       =
    " IMPORTING
    "   NAVIGATION_DATA          =
      TABLES
        IT_RANGES                =
        ET_RESULT                =
    "   ET_TEMPLATE              =
        RETURN                   =
    Regards,
    Lalit Mohan Gupta.

  • FM HRTRV_IF_GET_TRIP does not return USERDATA

    Hi, it's me, yet again...
    I'm using the FM "HRTRV_IF_GET_TRIP" in FITE_VC_GENERA_DATA in a post exit of comp-controller method "ON_SHOW" to get the structure/Table USER/PTK99 from the TE Cluster for binding to the context afterwards. At least that's the plan. The FM does not return me the data I expect in parameter USERDATA, although there is data in the TE Cluster and within the FM, I can see the global Table USER being filled whilst the macro RP-IMP-C1-TE. But this data is not further process neither is seems the strucutre USERDATA to be touched at any point of the FM. Am I calling the FM 'wrong' in any way? I'm close to making an implicit enhancement at the end and forcefully fill userdata from user....
    Too long, didn't read: USERDATA is not returned filled --> WHY?
    CALL FUNCTION 'HRTRV_IF_GET_TRIP'
      EXPORTING
        employeenumber             = wd_assist->GS_COMMON_RFC_INPUT-employee_number
        tripnumber                 = lv_tripno
    *   LANGUAGE                   = SY-LANGU
    *   CALCULATE_AMOUNTS          = 'X'
    *   GET_TRIP_FROM_MEMORY       = ' '
      IMPORTING
    *   FRAMEDATA                  =
    *   STATUS                     =
        USERDATA                   = ls_user " should contain cluster values, but it doesn't
      tables
    *   RECEIPTS                   =
    *   ADDINFO                    =
    *   GUESTS                     =
    *   TEXT                       =
    *   MILEAGE                    =
    *   STOPOVER                   =
    *   DEDUCTIONS                 =
    *   COSTDIST_TRIP              =
    *   COSTDIST_STOP              =
    *   COSTDIST_RECE              =
    *   COSTDIST_MILE              =
    *   AMOUNTS                    =
    *   ADVANCES                   =
        return                     = lt_bapiret " says method was executed successful
    In the insides of the FM:
    *  IF CALCULATE_AMOUNTS <> 'X'. "XJY
    * import the trip because it was NOT imported before
      READ TABLE T_PERIO INDEX 1.
      TE-KEY-PERNR = T_PERIO-PERNR.
      TE-KEY-REINR = T_PERIO-REINR.
      TE-KEY-PERIO = T_PERIO-PERIO.
      TE-KEY-PDVRS = T_PERIO-PDVRS. " Once this line is executed, the global table USER is fileld with the data I expect
      RP-IMP-C1-TE.
    *  ENDIF. "XJY
      if t_perio-abrec = '0' or
         t_perio-abrec = '1'.
        clear te-key-pdvrs.
        import beler from memory id te-key.
      endif.
    I hope somebody has ever used this one and can tell me what I'm doing wrong...
    Cheers, Lukas

    good to know. that you have already implemented similar thing. In our case if employee want to pick a manager he will only be given option from a custom table entries.
    They way i was thinking was that there will be a checkbox that will say "Override Approver"
    and when that will be checked text filed will be enabled with search help restricted to custom table entries.
    I have one question. When I am enhancing FITE_VC_REVIEW and adding field in that view, I m finding it hard to track it. Looks like adding to General data screen will be much easier.
    R u using ABAP memory to track field and use it at SMOD or you are using SAP memory ?
    I am just starting on this one and not expert at webdynpros.. will ping you if i need any more help
    and yes i just added following like in FM HRTRV_IF_GET_TRIP
    read TABLE user INTO userdata INDEX 1
    to get it to load userdata..

  • VOD Sound drop at commercials and does not return when TV show resumes

    i've noticed that there are other customers experiencing this problem and I have not seen any response from COmast support.When playing a TV-Show from On-Demand, the sound drops when a commerical starts and does not return when the TV Show resumes.A reenct example: Walking Dead 515.Yes, I have called comcast support to report it.Of course they wanted me to go through the standard drill - Power Off/On; Refresh Signal; etc. with no result...The  problem occurs on series, e.g. - Walking Dead 515; Grey's Anatomy;  It happens after the episode has been in the On Demand listing for about a week.It seems that the sponsors are no longer paying for the commercial, so the sound drops when the commercial comes on.However, the sound does not come back when the commercials end and the show comes back on.Stopping playback and starting at that point returns the sound, but, - oftentimes, the counter doesn't advance correctly in the Recently Viewed listing, so you end up starting back to the last time you stopped it. This is clearly a bug on the back-end, and I don't expect it to be fixed until enough people complain and Comcast Support replicates the problem observes it for themselves.

    I have this EXACT problem on Anthony Bourdain's show Parts Unknown and the Last Ship.  As soon as it hits the advertizement sound drops and continues as dropped.  Pausing and restarting the program completely after exit regains sound but as soon as it hits another commercial it goes out again.  The counter problem makes this option only good for a few times.  Then it resets back.

  • Search does not return my documents

    Hi Gurus,
    I have created few documents using CM SDK. I could able to see these documents using IFS browser.
    Now I wrote content search method to search document content.When I search for "cmsdk" string it returns 13 documents.But when I search for a string in the document, I created , for example a text like "struts" it does not return any result , though this document I can see in IFS browser.What could be the reason?.
    BTW I didn't create any FORMAT type while I am storing the document. Can any one point me to a document where I can find some instructions on "must and should things to do before search".
    I am using CM SDK 9.0.3.
    Thanks in advance.
    Giri.

    have you set the indexing on?

  • When using rabbitmq-jms for vFabric RabbitMQ javax.jms.Message.getJMSDestination does not return the actual destination when it is received from a consumer listening on a Topic with a wild card

    When using rabbitmq-jms for vFabric RabbitMQ javax.jms.Message.getJMSDestination does not return the actual destination when it is received from a consumer listening on a Topic with a wild card. I have tested with both 1.0.3 and 1.0.5 clients with RabbitMQ 3.1.5.
    I was wondering if the community was aware of this problem and if there are any workarounds? If not what is the proper channel to file a bug report. An example code snippet is below. The test fails because the TextMessageMatcher expects the destination passed in on construction (second parameter) to equal the desination on the message received (aquired from getJMSDestination).
            Mockery context = new Mockery();
            final MessageListener messageListener = context.mock(MessageListener.class);
            final Latch latch = new LatchImpl();
            final String prefix = "test" + System.currentTimeMillis();
            context.checking(new Expectations() {
                    oneOf(messageListener).onMessage(with(new TextMessageMatcher("MSG1", prefix + ".1234")));
                    will(new CustomAction("release latch") {
                        @Override
                        public Object invoke(Invocation invocation) throws Throwable {
                            latch.unlatch();
                            return null;
            final Connection connection = createConnection(null, null);
            Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
            connection.start();
            Topic wildcardTopic = (Topic) getInitialContext().lookup(prefix + "." + "#");
            Topic destination = (Topic) getInitialContext().lookup(prefix + ".1234");
            final MessageConsumer consumer = session.createConsumer(wildcardTopic);
            consumer.setMessageListener(messageListener);
            MessageProducer producer = session.createProducer(null);
            producer.send(destination, session.createTextMessage("MSG1"));
            latch.await(5000);
            connection.close();
            Thread.sleep(5);
            context.assertIsSatisfied();

    Check where your MDB sends the [response] messages to.

  • Xquery does not return any results on 10.2.0.4, does work on 10.2.0.5

    I have a Xquery statement that works as expected on Oracle 10.2.0.5 but does not return any results on Oracle 10.2.0.4.
    Is this the result of a badly written query? A bug in 10.2.0.4?
    Is there a way to rewrite the query so that is does work on 10.2.0.4?
    Testcode:
    declare
       l_xml xmltype;
       -- Select layers with TileMatrixSet EPSG:28992
       cursor c_layer(p_xml xmltype) is
          select t.*
            from xmltable(xmlnamespaces(default 'http://www.opengis.net/wmts/1.0'
                                       ,'http://www.opengis.net/ows/1.1' as "ows"
                                        ,'http://schemas.opengis.net/gml' as "gml"
                                        ,'http://www.w3.org/1999/xlink' as "xlink"
                                        ,'http://www.w3.org/2001/XMLSchema-instance' as "xsi")
                          ,'for $d in //Layer[TileMatrixSetLink/TileMatrixSet="EPSG:28992"] return $d' passing
                          p_xml columns title varchar2(100) path 'ows:Title'
                          ,format varchar2(100) path 'Format'
                          ,style xmltype path 'Style') as t;
    begin
       l_xml := xmltype.createxml('<?xml version="1.0" encoding="UTF-8"?>
    <Capabilities xmlns="http://www.opengis.net/wmts/1.0"
    xmlns:ows="http://www.opengis.net/ows/1.1"
    xmlns:xlink="http://www.w3.org/1999/xlink"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:gml="http://www.opengis.net/gml" xsi:schemaLocation="http://www.opengis.net/wmts/1.0 http://schemas.opengis.net/wmts/1.0/wmtsGetCapabilities_response.xsd"
    version="1.0.0">
    <Contents>
      <Layer>
        <ows:Title>brtachtergrondkaart</ows:Title>
        <ows:Identifier>brtachtergrondkaart</ows:Identifier>
        <Style isDefault="true">
          <ows:Identifier>_null</ows:Identifier>
        </Style>
        <Format>image/png8</Format>
        <TileMatrixSetLink>      <TileMatrixSet>EPSG:28992</TileMatrixSet>
        </TileMatrixSetLink>  </Layer>
      <Layer>
        <ows:Title>top10nl</ows:Title>
        <ows:Identifier>top10nl</ows:Identifier>
        <Style isDefault="true">
          <ows:Identifier>_null</ows:Identifier>
        </Style>
        <Format>image/png8</Format>
        <TileMatrixSetLink>      <TileMatrixSet>EPSG:28992</TileMatrixSet>
        </TileMatrixSetLink>  </Layer>
      <Layer>
        <ows:Title>bgt</ows:Title>
        <ows:Identifier>bgt</ows:Identifier>
        <Style isDefault="true">
          <ows:Identifier>_null</ows:Identifier>
        </Style>
        <Format>image/png8</Format>
        <TileMatrixSetLink>      <TileMatrixSet>EPSG:28992</TileMatrixSet>
        </TileMatrixSetLink>  </Layer>
    </Contents>
    </Capabilities>');
       for r_layer in c_layer(l_xml)
       loop
          dbms_output.put_line(r_layer.title);
       end loop;
    end;Result on 10.2.0.5:
    brtachtergrondkaart
    top10nl
    bgt

    This one's strange indeed.
    I can reproduce on 10.2.0.4 and one of the following seems to fix it :
    1) Specifying the column list in the SELECT, instead of t.* :
       -- Select layers with TileMatrixSet EPSG:28992
       cursor c_layer(p_xml xmltype) is
          select t.title, t.format, t.style
            from xmltable(or,
    2) Using an extended FLWOR expression :
    for $d in //Layer
    where $d/TileMatrixSetLink/TileMatrixSet = "EPSG:28992"
    return $dMaybe you've already noticed but the problem only occurs within a PL/SQL context.
    The same query run from SQL is OK.

  • Designer 10gR2 :API: JR_CHECK_REF.CHECK_FOL_REFS does not return proper res

    Summary: API: JR_CHECK_REF.CHECK_FOL_REFS does not return proper results
    Description:
    For User Extensions, the API is returning unexpected/unexplained results for Association types identified as not in the repository.
    Scenario 1) EL_TYPE and REF_TYPE return properties that are not aligned with either the EL_IRID/EL_IVID, EL_PAR_IVID, or REF_PAR_IRID.
    However, REF_IRID (pointing to the missing object) is correct.
    Scenario 2) EL_TYPE and REF_TYPE return properties that are not aligned with either the EL_IRID/EL_IVID, EL_PAR_IVID, or REF_PAR_IRID.
    However, all the objects are present in the repository.
    Any idea?
    ~Shampa M.

    You might get a better response if you ask this in the Designer Forun.

  • 0EC_PCA_3 does not return data in RSA3 if the target system is entered

    Hello all,
    Datasource 0EC_PCA_3 is not transferring data to the BW 7.0 system. In the ECC 6.0 system datasource 0EC_PCA_3 does not return data in RSA3 if the target system (BWDCLNT100) is entered in the selection fields. When omitting the target system all expected data is returned.
    Datasource 0EC_PCA_1 works fine for the same target system.
    There is one thread dealing with the same problem but the person does not provide the solution he found.
    Does anyone know what the issue is?
    Regards and thanks,
    József.

    The problem was solved by removing the datasource in both BW and R/3 and activating everything from scratch again. We didn't find out what was the cause of the problem, but at least it is working now.

  • UPDATE ... RETURNING does not return new value

    Hi all,
    I've created the following objects in Oracle DB 10.2.0.3.0:
    CREATE TABLE TAB1
         ID          NUMBER          PRIMARY KEY,
         EDITED_AT     DATE,
         VALUE          VARCHAR2(64)
    CREATE SEQUENCE S_TAB1
         INCREMENT BY 1
         START WITH 1;
    CREATE TRIGGER T_TAB1_BIE
    BEFORE INSERT OR UPDATE ON TAB1
    FOR EACH ROW
    BEGIN
         IF INSERTING THEN
              SELECT S_TAB1.NEXTVAL INTO :NEW.ID FROM DUAL;
         END IF;
         :NEW.EDITED_AT := SYSDATE;
    END;
    /Then I tried to do the following in SQL Plus:
    SQL> insert into tab1(value) values('ddd');
    1 row created.
    SQL> commit;
    Commit complete.
    SQL>
    SQL> select * from tab1;
            ID EDITED_AT           VALUE
             1 27.03.2008 17:01:24 ddd
    SQL>
    SQL> declare dt date; val varchar2(64);
      2  begin update tab1 set value = 'ddd' where id = 1 returning edited_at, value into dt, val;
      3  dbms_output.put_line('txt = ' || dt || ', ' || val);
      4  end;
      5  /
    txt = 27.03.2008 17:01:24, ddd
    PL/SQL procedure successfully completed.
    SQL>
    SQL> select * from tab1;
            ID EDITED_AT           VALUE
             1 27.03.2008 17:02:12 ddd
    SQL>As it can be seen Returning clause of an Update statement does not return a new date, i.e. 27.03.2008 17:02:12, that was updated by the trigger, it returns an old one - 27.03.2008 17:01:24. Please advise me why Database returns an old value? I do believe that UPDATE ... RETURNING ... statement should return new, generated by the trigger, value.
    Thanks in advance.
    Regards,
    Yerzhan.

    you need to explicitly include the column in your UPDATE statement SET clause that you expect to return the result you want it to be. here's what i think what happened even though you have a trigger the first statement that was processed was your update statement. at the time of the update it has to return the current values to the returning clause that is the values on the table. now comes next the trigger which gives edited_at column a new value. when the trigger got fired the process don't return anymore to the UPDATE RETURNING statement. it's like each sequence of codes does not executes in parallel.
      SQL> CREATE TABLE TAB_1
        2  (
        3   ID  NUMBER  PRIMARY KEY,
        4   EDITED_AT DATE,
        5   VALUE  VARCHAR2(64)
        6  );
      Table created.
      SQL> CREATE SEQUENCE S_TAB1
        2   INCREMENT BY 1
        3   START WITH 1;
      Sequence created.
      SQL> CREATE TRIGGER T_TAB1_BIE
        2  BEFORE INSERT OR UPDATE ON TAB_1
        3  FOR EACH ROW
        4  BEGIN
        5   IF INSERTING THEN
        6    SELECT S_TAB1.NEXTVAL INTO :NEW.ID FROM DUAL;
        7   END IF;
        8   :NEW.EDITED_AT := SYSDATE;
        9  END;
       10  /
      Trigger created.
      SQL> insert into tab_1(value) values('ddd');
      1 row created.
      SQL> commit;
      SQL> select * from tab_1;
              ID EDITED_AT            VALUE
               1 28-mar-2008 10:31:18 ddd
      SQL> declare dt date; val varchar2(64);
        2  begin update tab_1 set value = 'ddd', edited_at = sysdate
        3        where id = 1 returning edited_at, value into dt, val;
        4  dbms_output.put_line('txt = ' || dt || ', ' || val);
        5  end;
        6  /
      txt = 28-mar-2008 10:32:39, ddd
      PL/SQL procedure successfully completed.
      SQL> select * from tab_1;
              ID EDITED_AT            VALUE
               1 28-mar-2008 10:32:39 ddd
      SQL>

  • WebI does not return failed when scheduling a report which only holds parti

    WebI does not return failed when scheduling a report which only holds partial results.
    We have scheduled reports which take some time to run. When they are scheduled they sometimes show successful even though the report only holds partial results. The only indication is when you open the report as webi report you see the warning that it holds partial results.
    When running the report manually, it works file.
    The issue is not in the no of rows in the universe settings because we this unselected. The issue is that it times out.
    The reason that it times out is that a lot of resources are used for loading and processing data when the report is scheduled. When running it manually, it works because at this time the serverload is less. the time in the universe is set to 10 min.
    The version we have is BOXIR2-SP4.
    Ok. Issue identified.
    The question is - why is the report successful when it holds partial results? If this is normal behavior, noone can really trust the scheduled reports, especially when you save it to excel and send it by mail.
    Is there a solution for this except increasing the allowed query time which would not solve the issu but only allow more reports to complete?
    Edited by: Karlgren Michael on Sep 17, 2009 1:22 PM

    Hi ,
    Currently this problem exists in XI R2. This feature will be part of thenext Service Pack i.e XI R2 SP6.
    This CER will be delivered from IDC Webi and BIP Platform as part of Jupiter Sp6.
    Problem Statement:
         Scheduled WebI Reports which are partially refreshed are distributed to the destinations for Users to View and make decisions. These users arenu2019t usually aware that these reports have u201CPARTIAL RESULTSu201D
    Recomended Solution:
        Allow the Schedule Creator / Modifier to set a parameter to stop the distribution of the u201CPARTIALLY REFRESHEDu201D WebI report.
    Thanks
    Salini

Maybe you are looking for

  • Report to be mailed to different persons

    Hi, I have a classical report having informations of diferent employees. This needs to be mailed to their respective supervisors as attachment but with the condition that each supervisor should get the attachment having details of his subordinates on

  • My monitor looks 90 degrees to the right

    My monitor looks 90 degrees to the right. How can I fix this?

  • List selection behaviour

    Hi, The JList moves to a item beginning with the key that I typed on it. Is there a way to stop this behaviour and move the list to some other position that I need to. Thanks a lot, Chamal.

  • Downloads are not showing up in window. Can someone help? Thank you.

    Just recently, downloads are not appearing in the Download window. Under "Tools/Options"... "Show the Downloads window..." is checked. "Save files to" ( C:\Downloads ) is checked.

  • Function module for Vendor

    Hi Pls help me out, Any function module , which takes Input as a Vendor ID and returns Vendor Name(Formatted Name). Regards Arya