I want to create a PL/produces that checks the start date and end date in the database. here is my data
HAS_CONTRACT DATE_FROM DATE_TO DURATION
---------------------------------------- --------- --------- -----------------------------
Simon Palm 20-AUG-01 19-AUG-02 0
Simon Palm 20-SEP-02 19-AUG-03 0
Flut 10-JUN-99 09-SEP-02 0
John Cliff 10-MAR-03 10-APR-04 0
If the user trying to input a person that has the same date_from and date_to, then it should not be permitted, therefore a exception error. Here is how far i did, but i am sure thats not how a procedure should be. Any help?
CREATE PROCEDURE insertTuple(
x contractinfo.date_from%Type,
y contractinfo.date_to%Type)
AS
BEGIN
IF x!=y THEN
INSERT INTO contractInfo VALUES(x,y);
END;
/