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 576767
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T14:04:55+00:00 2026-05-13T14:04:55+00:00

i’m trying to make a TRIGGER in ORACLE using ORACLE SQL DEVELOPER, I would

  • 0

i’m trying to make a TRIGGER in ORACLE using ORACLE SQL DEVELOPER, I would check that the dates entered as start date reservation to reservation date or date of a service charge will be equal to or greater than the current date is inserted in the record.

these are the fields in my table

Service (date_service, cost_variation, number_room, id_service);

this is my code:

CREATE OR REPLACE TRIGGER VERIFY_DATE
BEFORE INSERT OR UPDATE OF FECHA_PLAN ON SERVICE
FOR EACH ROW
DECLARE
  fecha_ac DATE;
BEGIN
  SELECT SYSDATE INTO fecha_ac FROM DUAL;
  IF(:NEW.FECHA_PLAN > fecha_ac)THEN
    dbms_output.put_line('The date of the plan should be more than the current date ');
    raise_application_error(-20601, 'Dato invalido');
  END IF;
END;

and this is the error I get when trying to run the TRIGGER

INSERT INTO "MIGRARBD"."SERVICE" 
    (date_service, cost_variation, number_room, id_service) 
VALUES 
    (TO_DATE('20/01/10', 'DD/MM/RR'), '2', '1', '1')

There was an error when saving changes to table “MIGRARBD”.”SERVICE”:

Fila 1: ORA-20601: Dato invalido
ORA-06512: en "MIGRARBD.VERIFICAR_FECHA", línea 7
ORA-04088: error during execution of trigger 'MIGRARBD.VERIFICAR_FECHA'
ORA-06512: on line 1

I hope you can help … and excuse my English

  • 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-13T14:04:56+00:00Added an answer on May 13, 2026 at 2:04 pm

    Your trigger references FECHA_PLAN which doesn’t match how you have defined the table. Presumably it is the same as DATE_SERVICE.

    As you have coded it, the trigger fails if the entered date is greater than the current date. But when you say …

    I would check that the dates entered
    … will be equal to or greater than
    the current date is inserted in the
    record.

    … perhaps what you want is to enforce a rule that the date must be greater or equal to the current date. If so, your trigger ought to fail if the entered date is less than the current date. Like this …

    IF(:NEW.FECHA_PLAN < sysdate )THEN

    Note that we can use sysdate directly, so the select ... from dual is unnecessary (unless as Rene points out in the comments you want to use the same value multiple times).

    If this doesn’t address your problem you will need to explain a bit more.

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

Sidebar

Ask A Question

Stats

  • Questions 399k
  • Answers 400k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Perhaps this trick might help: A scending A B C… May 15, 2026 at 4:05 am
  • Editorial Team
    Editorial Team added an answer Very weird behavior. Maybe it's a problem with content permission? May 15, 2026 at 4:05 am
  • Editorial Team
    Editorial Team added an answer You can use JSONP to send a string containing raw… May 15, 2026 at 4:05 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.