Trigger with sdo_inside

Hello,
I have problems with my trigger. I want to know in witch polygon a point is. When I create a select-statement like this
select p.fid, p.FID_SG_OBJEKT_O, f.fid from POINT p, POLYGON f where SDO_INSIDE (p.GEOM, f.GEOM) = 'TRUE'
then I have no problems. It works fine.
Now a trigger should do this work:
create trigger ...
begin
select fid into :new.FID_SG_OBJEKT_O from POLYGON where SDO_INSIDE (:new.GEOM, GEOM) = 'TRUE';
end;
Then following message I get:
execution error, ORA-13226:
I rebuild all spatial-triggers without errors.
Do you know what's wrong?
Thanks!
Edited by: user3163638 on 24.10.2008 00:01

the first geometry inside the sdo_INSIDE must come from a table and have a spatial index (that is also what your ora error is a saying).
http://download.oracle.com/docs/html/B14255_01/sdo_operat.htm#sthref1036:
geometry1      Specifies a geometry column in a table. The column must be spatially indexed. Data type is SDO_GEOMETRY.
actually you want to know what is the polygon that contains the input point.
http://download.oracle.com/docs/html/B14255_01/sdo_operat.htm#sthref1036
if the point table has the trigger on it you should write it as:
select fid into :new.FID_SG_OBJEKT_O from POLYGON p where SDO_CONTAINS (p.GEOM, :new.geom) = 'TRUE';
Not sure how you defined :new (and maybe :old) could be that the parameter inside the sdo_contains should :old.geom.
Hoping this helps you out.
(additionally check your requirements to cover the case where a point is on the boundary of 1 or multiple polygons)
Luc
Edited by: lucvanlinden on Oct 24, 2008 10:22 AM

Similar Messages

  • How can i make trigger with basler camera GIGE 659x494 - 70 FPS and I/O terminal block

    Hi all,
    How can i make trigger with basler camera GIGE 659x494 - 70 FPS and I/O terminal block

    Frank,
    If you are wiring an isolated power output to the EVS you will need to apply a power supply to the terminal block.  This is mentioned in the "wiring isolated power output" section of the EVS getting started guide located here.  The guide references the EVS user manual which provides a pinout of the d-ub connector in table 2-11 of the manual located here.  For more information on the camera settings you need to set on the Basler camera please see the user manual of the camera you refrenced here.
    To provide power to the camera you can purchase a power cable for the camera.  Rather than a power cable, since you want to also do triggering, you will want a Trigger and I/O Cable instead which is part number 779985-01 as seen on this product page.  The I/O cable would allow you to wire the trigger lines to the terminal block as well as the power lines.
    David A
    National Instruments
    FlexRIO Product Support Engineer

  • Is it possible to start a PCI4472 and a PCI-MIO-16E-1 simultaneously using an analog trigger (with pre-trigger)?

    I would like to start several PCI 4472 and a PCI-MIO-16E-1 simultaneously. All boards are connected via a RTSI cable.
    My program works fine if I use software trigger, or an analog trigger from a PCI4472 channel. However, the analog trigger works only when I set pre-trigger (or pre-scan) to 0.
    Is it possible to start a PCI4472 and a PCI-MIO-16E-1 simultaneously using an analog trigger (with pre-trigger)?
    Thanks.
    Ian Ren

    Hi, Bill
    I think it is possible to set more than 38 pre-trigger scans on a single 4472 card. I've done this before. You can verify this by running the Labview example "Acquire N - Multi-Analog Hardware Trig.vi" which comes with LabView.
    What I try to do but without success/luck so far is to start data acquisitions of several 4472 cards and a PCI-MIO-16E-1 card using an anlog trigger (with pre-trigger).
    Thanks for your help.
    Ian

  • Trigger with entire row

    Hi all!
    I've a before insert trigger.
    I want to call a procedure within this trigger, with a record input param.
    How can I pass the ":NEW" as a record type?
    Thanks!

    unfortunatly this is not possible.
    You have to pass all :NEW values separately. Or transfer then to a rowtype first like:
    declare
       v_new_row table%rowtype;
    begin
      v_new_row.col1 := :NEW.col1;
      v_new_row.col2 := :NEW.col2;
      v_new_row.col3 := :NEW.col3;
      v_new_row.col4 := :NEW.col4;
      v_new_row.col5 := :NEW.col5;
      v_new_row.col6 := :NEW.col6;
      do_something(v_new_row);

  • Trigger with progressive

    Hi,
    I've this table:
    CREATE TABLE MY_TAB (
    ID VARCHAR2 (24) NOT NULL,
    NAME_ID VARCHAR2 (32) DEFAULT NULL,
    PRIMARY KEY (ID ));
    I'd like to create one trigger that for each NAME_ID insert into ID column the value "NAME_ID-progressive of 3 digit"
    For example:
    INSERT INTO MY_TAB ( NAME_ID) VALUES ('999');
    ID..............NAME_ID
    999-001.........999
    INSERT INTO MY_TAB ( NAME_ID) VALUES ('999');
    ID..............NAME_ID
    999-001.........999
    999-002.........999
    INSERT INTO MY_TAB ( NAME_ID) VALUES ('88888');
    ID..............NAME_ID
    999-001.........999
    999-002.........999
    88888-001.......88888
    INSERT INTO MY_TAB ( NAME_ID) VALUES ('88888');
    ID..................NAME_ID
    999-001.............999
    999-002.............999
    88888-001...........88888
    88888-002...........88888
    INSERT INTO MY_TAB ( NAME_ID) VALUES ('999');
    ID..................NAME_ID
    999-001.............999
    999-002.............999
    88888-001...........88888
    88888-002...........88888
    999-003.............999
    INSERT INTO MY_TAB ( NAME_ID) VALUES ('999')
    ID..................NAME_ID
    999-001.............999
    999-002.............999
    88888-001...........88888
    88888-002...........88888
    999-003.............999
    999-004.............999
    The trigger is like this:
    CREATE OR REPLACE TRIGGER TRG_MY_TAB
    BEFORE INSERT ON MY_TAB
    REFERENCING NEW AS NEW OLD AS OLD
    FOR EACH ROW
    WHEN (NEW.ID IS NULL)
    BEGIN
    SELECT (:NEW.NAME_ID ||('-here progressive'))
    INTO :NEW.ID
    FROM DUAL;
    END;
    How can I create this trigger with progressive
    Thank in advance!

    Create an auxiliary table:
    CREATE TABLE progressive
    (name_id VARCHAR2(32) NOT NULL PRIMARY KEY
    ,seq NUMBER NOT NULL
    /And then call this function in your trigger:
    CREATE OR REPLACE FUNCTION next_progressive (p_name_id IN progressive.name_id%TYPE)
                               RETURN NUMBER IS
      l_seq NUMBER;
    BEGIN
      LOOP
        BEGIN
          SELECT seq INTO l_seq
            FROM progressive
            WHERE name_id = p_name_id
            FOR UPDATE;
          UPDATE progressive
            SET seq = seq + 1
            WHERE name_id = p_name_id;
          RETURN l_seq;
        EXCEPTION
          WHEN no_data_found THEN
            BEGIN
              INSERT INTO progressive (name_id, seq)
                VALUES (p_name_id, 2);
              RETURN 1;
            EXCEPTION
              WHEN dup_val_on_index THEN
                null;
            END;
        END;
      END LOOP;
    END;
    /

  • Software trigger with PCI-5122

    I am going to program a board with PCI-6552 and in meantime in specific times capture the samples of the anolog output of the board by PCI-5122.
    Is there any way to use software trigger and the data pattern of PCI-6552 (e.g. define a software event) to trigger the PCI-5122. If it is possible, how the software event can be defined and connected to the "send software trigger" block?

    Whe using a software trigger with the 5122, you generate the trigger whenver you call the "Send Software Trigger" function. you can program the software events that cause this funtion to be called in any way you want.
    In the simplest case, you could place the "Send Software Trigger" function in a while loop and only execute it when the user presses a button.
    Jack

  • How do I use a push button digital trigger with my 6034E DAQ board?

    I am only a Lab View toddler.
    I am currently using a push button, wired to PFIO/TRIG1 and DGND, with a anolog trigger. However noise is causing my program to be triggered. I was told that a digital trigger would help to reduce the random triggering. How do I create a push button digital trigger?
    Thanks

    implement a schmitt trigger.
    Struggling with Labview wrote in message
    <[email protected]>...
    >I am only a Lab View toddler.
    >I am currently using a push button, wired to PFIO/TRIG1 and DGND, with
    >a anolog trigger. However noise is causing my program to be triggered.
    >I was told that a digital trigger would help to reduce the random
    >triggering. How do I create a push button digital trigger?
    >Thanks

  • How to use digital trigger with analog I/O

    How do I program analog input and/or analog output to start on a digital trigger (PFI pin) on PCI-4451/4551.
    I have tried out various configuration and succeeded in starting analog input, simultanuous input and output triggered by the the anlaog input signal. I have also succeded i triggering 4551 from the dedicated EXTTRIG pin.
    The problem is to trigger on a selectable PFI pin. I find the help for "AI Trigger Config" and "AO Trigger and Gat Config" misleading - some unsupported features seem to work while selecting PFI pin as source make the PC restart immediately.
    I have not been able to find any LabVIEW example that shows how to use PFI pin as trigger input.
    Using LabVIEW 7.1, NI-DAQ 7.3 on Windows 2000.
    Kind regards / Med venlig hilsen
    Torben

    Hello
    The PCI-4451 does not have any PFI lines. If you look at the user manual in the link beneath you will be able to confirm this by looking at the connector signal discriptions. The same is valid for the PCI-4451
    http://digital.ni.com/manuals.nsf/websearch/6A32358C53BB15F086256660007392DC?OpenDocument&node=132090_US
    The two ways of triggering that you have succeded are the analog triggering and digital triggering that you can peform with the PCI-4451.
    Regards
    Mohadjer

  • Error while using sybase trigger with the CMP entity bean,ejb version 2.1

    Hi All,
    I am using ejb version 2.1 and using entity bean (Transaction required) ,i am trying to update data in sybase(ver 12.3) database table
    I am using session bean(Transaction required) to update the multiple entity beans in a while loop.It is working fine .But when i am trying to run it with the trigger which updates multiple tables in different sybase databases on update of each entity.Then it throws NoSuchEntityException and it rollback the whole transaction.
    My trigger has only few simple update statements and the trigger runs fine without my CMP entity bean.is the CMP does not support the update triggers in sybase or is it the problem with the transaction.
    Please help
    Thanks
    Anshu

    If you can have a look at a cmp example in the samples that ship with the server. My guess is that the weblogic-ejb-jar.xml file is missing the <persistence-use> element which for 810 would look like:
    <persistence>
    <persistence-use>
    <type-identifier>WebLogic_CMP_RDBMS</type-identifier>
    <type-version>7.0</type-version>
    <type-storage>META-INF/weblogic-cmp-rdbms-jar.xml</type-storage>
    </persistence-use>
    </persistence>
    I seem to recall that the elements might be slightly different in structure for the wls700 version of the DTD, so please check that (I cannot, I'm at home and don't have everything here).
    Give that a try and see if it doesn't solve your compilation failure.
    Also, the compilation should not be throwing a null pointer exception in a case like that, I consider that to be a bug.
    -thorick

  • Logging data after a trigger with Lookout Direct

    Hi,
    I would like to log data with Lookout Direct after a trigger input (not periodically or continuously).  I am using Lookout DIrect version 4.5.1 build 19 and a Direct Logic 250 PLC.
    Does anyone have suggestions on how to do this?  I would prefer that this data be logged into Excel.  I have 24 sensors connected to the PLC and each time a sensor transitions from hi to low I would like to log the time of transition. 
    Currently I have individual spreadsheet storage objects for each sensor as well as individual latchgates to indicate when logging has been completed.  In the PLC code there is a state machine for each individual sensor as well and one of the states waits for an acknowledgement from Lookout that data logging has been completed before moving on to the next state (I will have to dig a bit deeper to remember exactly why I needed to do that).
    I am hoping there is a more traditional approach that is easier than what I am doing.  One of the problems I have been facing is Lookout Direct crashing every few days and I suspect it is because the sensors are often sensed within milliseconds of each other and opening/closing so many files is causing problems.  I worked through a list of possible reasons that Lookout may be crashing (provided by tech support) and I am nearly convinced I am just asking too much of the program...
    Any help will be greatly appreciated
    Thank you,
    David

    In case someone can help with this, here is a bit more information about my application and the PLC/Lookout code I have developed:
    Actuators have two positions, nominal and folded.  Prox sensors are used to monitor the position of actuators.  12 actuators can be monitored simultaneously.  The time at which prox sensors are sensed high is recorded so that actuator speed and actuation success is logged. 
    The PLC code consists of 12 separate state machines, each with the following 8 states:
    State 1
      System reset or nominal timer reset
      Wait for nominal prox release
    State 2
      Nominal prox released
      Wait for folded prox sense
    State 3
      Folded prox sensed
      Wait for folded ack from Lookout (acknowledges that timer value has been logged)
    State 4
      Folded ack from Lookout received
      Wait for folded timer reset (this state is active for one scan only)
    State 5
      Fold-in timer reset
      Wait for folded prox release
    State 6
      Folded prox released
      Wait for nominal prox sense
    State 7
      Nominal prox sensed
      Wait for nominal ack from Lookout (acknowledges that timer value has been logged)
    State 8
      Nominal ack received from Lookout
      Wait for nominal timer reset (this state is active for one scan only)
    Lookout acknowledges that timer values have been read and saved with LatchGates.  Lookout uses a SpreadSheet Storage Object to save the PLC timers when the PLC enters states 3 or 7 (prox sensor triggered).  The logged member of the SpreadSheet Storage Object is used to change the state of the LatchGates which, in turn, signal the PLC to proceed to the next state.  When the folded file is saved, the nominal LatchGate is turned off and the folded LatchGate is turned on and vice-versa for the nominal file.
    The LatchGate/SpreadSheet Storage combination is what I am hoping to improve upon.  I believe Lookout is crashing when 12 SpreadSheet Storage Objects log to 12 different files during the same 1 second period of time.
    If anyone has suggestions of a way to log this data in the PLC memory or a software package better suited for this application, please let me know!  I believe this would be simple with LabVIEW, unfortunately obtaining the additional hardware and software that I would need hasn't been easy! 

  • Monitor multiple channels for analog trigger with DAQmx drivers

    Hello! I would like to start a data acquisition of multiple analog channels (16) from an analog trigger. I would like trigger to monitor four of the (same) channels, and trigger when any one of them reaches a certain voltage. I found an example that would work with the Traditional DAQ drivers (using occurances), but can't figure out how to do something similar in DAQmx.
    Time is also an issue, as I would like to collect the first 80 milliseconds of data after the trigger (at a rate of 500,000 Hz).
    I'm using LabView 7.0 and collecting data off of two PXI-6133 cards.
    Thanks for your help!

    Hi Denise-
    After some research, I have found that it is not possible to use the functionality of DAQ Occurrences in DAQmx. Ironically, the reason that this functionality is available in Traditional and not DAQmx is due to the exploitation of an inherent limitation of Traditional that was upgraded in DAQmx. The multi-thread capability of DAQmx is a major advantage for most applications, but in this case it prevents the use of occurrences as they existed in Traditional DAQ.
    In short, this means that you can't directly use this functionality in DAQmx. You can however emulate this functionality with minimal software analysis of the incoming signal. I have attached a modified example VI that logs data to a chart only when the analog level of one of the channels being measured has exceeded a user-defined reference value. Basically, the task is running continuously in the background but the data is not actually logged until the signal is above a predetermined "trigger" level.
    Please let me know if the attached example is helpful for your application. You will see the input channels listed in the format "DevX/ai0:y" where X is the device number and y is the highest channel number of interest.
    Regards,
    Tom W
    National Instruments
    Attachments:
    Cont Acq&Graph Voltage-Int Clk Analog SW Trigger.vi ‏83 KB

  • Outlook keeps loading... But when you trigger (with something else) an administrator UAC login screen & login, outlook starts.

    Hi,
    We have a user that has the following problem on a fresh installed w7 64bit installation.
    When he starts outlook he gets the Loading... screen for like 2 minutes and then he gets an error: outlook is already running close outlook... (i translated this from dutch).
    I have tried logging into this computer with an administrator account but i get the same error.
    However. When you have the Loading... screen & start something that will trigger the admistrator UAC screen (like mmc.exe). Outlook starts...
    I have reinstalled office but that doesn't help.
    Any idea's?
    Don't forget about Alt+Esc!

    Hi,
    Based on the error message "outlook is already running close outlook", please go to Task Manager to see whether Outlook.exe is stuck in the process. If yes, end its process and try to restart it, check if then it will start.
    I also suggest you use Process Monitor to find what is denied when starting Outlook:
    http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx
    I'm looking forward to helping you resolve the issue.
    Regards,
    Melon Chen
    Forum Support
    Come back and mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback on our support, please click
    here

  • Mutating table exception on trigger with After Insert but not with before

    Hi
    I need to maintain some constraint on the table to have only one row for values of the columns but not by primary key constraint.
    Because in case of primary key the insert would fail and the rest of the operation would be discontinued, I cannot change in the somponent that inserts the row so I have to prevent that on the table I have.
    I created a before insert trigger on the table which checks if any row exists in the table with same column values as the one being inserted. if found I delete the rows and let the insert happen (w/o raising any error). if the rows do not exist then the insert shall be continued.
    I read at place that modifying the dame table in the trigger body shall raise a mutating table exception, but I donot get the exception when the trigger is fired.
    Just when I change the trigger to after insert trigger then the nutating table exception is thrown.
    Is it the right behavior i.e. the Before insert trigger does not raise the exception and only after insert does that, since I could not find the example for before insert triggers throwing such exception so I think it is better to confirm it before finalizing the implementation.
    Thanks
    Sapan

    sapan wrote:
    Hi Tubby
    I cannot user unique constraint because that would raise an exception upon violation and the third party component that is inserting in the table would fail.
    That component does some other tasks as well after this insert and if an exception is raised then those tasks would not be performed.
    Also I cannot change the component to ignore this exception.Well then, you're in a bit of a pickle.
    I'm guessing the trigger you have been working on isn't "safe". By that i mean that it doesn't account for multi-user scenarios. You'll need to serialize access to the data elements in question and implement some sort of locking mechanism to ensure that only 1 session can work with those values.
    After you work out how to do that it sounds as though you would be better served using an INSTEAD OF trigger (you'd need to implement this on a view which is made off of your base table).
    Here's one way you can work on serializing access to your table on a relatively fine grained level (as opposed to locking the entire table).
    Re: possible to lock stored procedure so only one session may run it at a time?
    Cheers,

  • Trigger with Nested Table

    How do I reference a column in a nested table in a trigger. I am issuing an update statement:
    UPDATE TABLE (SELECT inv_level
    FROM inventory_level
    WHERE machine_id = '1111'
    SET inventory_level = '15'
    WHERE column_id = '2'
    I want to create a trigger that execute before the insert. I want to insert the machine_id, the column_id, inventory_level into a change history table. The issue is he column_id and inventory_level fields are in the nested table. I tried to reference them as :NEW.column_id, but that didn't work.

    I too have had problems working with triggers & nested tables. This may help
    Imagine the scenario of a table that holds customer data that needs a specific record per user of the database to indicate if they can contact that customer.
    To solve this I created the following
    create type contact_type as object
    (username varchar2(30),
    can_mail number,
    can_phone number);
    create type contact_nt_type as table
    of contact_type;
    --table cust
    create table cust_table(
    custid number,
    custname varchar2(50),
    contact_nt contact_nt_type)
    nested table contact_nt store as contact_nt_tab;
    -- populate tables
    insert into cust_table
    values(1001,'Customer1',
    contact_nt_type(
    contact_type('SCOTT',1,0),
    contact_type('TIMS',0,1)));
    insert into cust_table
    values(1002,'Customer2',
    contact_nt_type(
    contact_type('SCOTT',0,0),
    contact_type('TIMS',0,0)));
    -- view cust_vu
    create or replace view cust_vu
    as
    select ct.custid, ct.custname, nt.can_mail, nt.can_phone
    from cust_table ct, table(ct.contact_nt) nt
    where nt.username = user;
    Now, if scott looks at the customer through the view he sees one set of contact details and if I look I see another. But if we try to update the view we get
    ORA-01733: virtual column not allowed here
    To solve this create an "instead of" trigger
    create or replace trigger cust_vu_update
    instead of update on cust_vu
    for each row
    begin
    -- update the parent table
    update cust_table
    set custname = :new.custname
    where custid = :old.custid;
    -- update the nested table
    update table(
    select contact_nt
    from cust_table
    where custid = :old.custid)
    set can_mail = :new.can_mail,
    can_phone = :new.can_phone
    where username = user;
    end;
    The documentation has a whole section on triggers & nested tables which, for me, did not solve any of my issues. Following the Create trigger syntax, specifically the dml_event_clause, caused me 0600 errors and my session was terminated!
    There may be better solutions but this one works for me.

  • Post Query Trigger with cursor

    Good afternoon to all of you!
    I need your help. I create a master detail form. I created also a post quey trigger, inside I wrote the code below.
    A cursor looks to another table and returns to the form some values i need!
    declare cursor C1 is select apofaa,startdate,enddate,transport
    from trapofdet
    where trapofdet.apofcode = :trapof.apofcode;
    begin
    open C1;
    loop
    fetch C1 into :TRAPODOSI_NEW_NEW.APOFAA, :TRAPODOSI_NEW_NEW.STARTDATE, :TRAPODOSI_NEW_NEW.ENDDATE, :TRAPODOSI_NEW_NEW.TRANSPORT;
    exit when C1%notfound;
    next_record;
    end loop;
    close C1;
    first_record;
    null;
    end;
    How to solve the a. frm-40737, illegal restricted procedure go block in post-query trigger
    b. It seems tha returns all the records but it appears only the last one.
    Please can anybody help with these?
    Thanks in advance!
    Christos

    Christos,
    The Post-Query trigger will fire once for each record returned to your form therefore you need to write your query to return a single row rather than a multiple rows. Using the Post-Query trigger to fetch additional data into your form can cause your form to be very slow - depending on the number of records returned and how many columns are fetched by your Post-Query cursor as well as how quickly the query executes.
    Is your Post-Query trigger on your Master or Detail block. Are you using the Post-Query trigger to populate your Detail block? Are you using a Block Relationship to coordinate your Master and Detail blocks?
    Also, it is helpful to know which version of Oracle Forms you're using.
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.

Maybe you are looking for

  • Is there any way to get my Mac back to normal?

    Hi, I posted this under intel iMac but it was suggested I come here for help. I've pieced together all the info from that post. My sister was using my computer and wanted to use Windows XP Professional Service Pack 2 in VMWare so booted a CD of Windo

  • How do I get my apps off my iPhone onto my mac

    I reciently had to replace my HD and now I want to get all my apps off my phone back onto my mac.  If I attempt to sync apps, it tells me all my apps and their data on my phone will be replaced with the apps on my mac (there are not any apps on my ma

  • Odata Service For Employee Information

    Hi Everyone, I want to call the odata service related to employee profile. But unable to find that service in my sap system. Can anybody tell me the name of the odata service which need to call from the gateway or from where I will get the name of th

  • Feather radius for selection depending on the image size

    Greetings everyone, I have a question about setting the feather radius for a selection depending on the image size. I'd like make the edge in the resultant layer mask have roughly the 'same' feather appearance for varying image sizes. For files below

  • Auto filling formula

    I am looking to use Numbers to do the following. I am required to know how many units are used in a specific amount of time. I know that complete unit is used in 25 minutes. I am trying to break it down to minute increments. I will also use this form