Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6865293
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:01:31+00:00 2026-05-27T03:01:31+00:00

we want to create a trigger which checks if a new measurement (=messung) point

  • 0

we want to create a trigger which checks if a new measurement (=messung) point lies within the current glacier shape (=umriss).

are tables look like this:

glacier shape (=Umriss)

create table umriss
(
 umr_nr       number (4) not null,
 umr_datum    date,
 GLST_ID      number (4) not null,
 shape        mdsys.sdo_geometry,
 GLETSCHER_ID number (3) not null
)
;

alter table umriss
add constraint umriss_glst_pk
primary key (umr_nr, GLST_ID, GLETSCHER_ID)
;

ALTER TABLE umriss 
ADD CONSTRAINT umriss_gletscherstand_fk 
FOREIGN KEY (GLST_ID, GLETSCHER_ID) 
REFERENCES GLETSCHERSTAND(GLST_ID, GLETSCHER_ID);

new measurement (=Messung)

CREATE TABLE MESSUNG
(
 MESS_NR      number (4) not null,
 MESS_DAT     date,
 MESS_AKK     number (20) NOT NULL,
 MESS_SCHMELZ number (20) NOT  NULL,
 SHAPE        mdsys.sdo_geometry,
 MESS_BILD    blob,  
 KMPGN_NR     NUMBER (4) NOT NULL
);

ALTER TABLE MESSUNG
ADD CONSTRAINT messung_pk
PRIMARY KEY (MESS_NR);

ALTER TABLE MESSUNG
ADD CONSTRAINT messung_messkampagne_fk
FOREIGN KEY (KMPGN_NR)
REFERENCES MESSKAMPAGNE(KMPGN_NR);

Trigger

CREATE OR REPLACE 
TRIGGER MESSUNG_in_UMRISS_TRI
BEFORE INSERT OR UPDATE ON MESSUNG
FOR EACH ROW
DECLARE 
   num_check NUMBER;
BEGIN 
   SELECT COUNT (*) INTO num_check
     FROM UMRISS u
    WHERE mdsys.sdo_contains (u.shape, :NEW.point) = 'TRUE';

   IF num_check <> 1
   THEN 
      RAISE_APPLICATION_ERROR (=20500, 'Messung in keinem Umriss')
   END IF; 
END; 

How do we iplement the function so the trigger only checks within the most curretn glacier shape?
Thanks for your help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T03:01:31+00:00Added an answer on May 27, 2026 at 3:01 am

    This will return the one row fron UMRISS which matches the most recent date in the table.

    SELECT COUNT (*) INTO num_check
    FROM UMRISS u
    WHERE mdsys.sdo_contains (u.shape, :NEW.point) = 'TRUE'
    AND u.umr_datum = ( select max(d.;umr_datum) from UMRISS d );
    

    This sort of query is the price for keeping historical data in teh same table as the current record.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to create trigger which will be fired after insert into some table,
I want to create a trigger to check what is being deleted against business
I want to create an allocator which provides memory with the following attributes: cannot
I want to create an own event (which I'll fire via code) for a
hi i have created a trigger which i want to update a table field
Hello all I am trying to create an in instead of insert trigger which
I want to create a trigger in Oracle 11g. The problem is that I
I want to make a trigger in ms sql server which saves every insert,update
I want create a drop shadow around the canvas component in flex. Technically speaking
I want create a excel with Apache POI in java and I must insert

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.