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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T14:32:33+00:00 2026-06-18T14:32:33+00:00

I am trying to create a trigger that will check that the date entered

  • 0

I am trying to create a trigger that will check that the date entered is in range if the Prog_Type entered is 'FILM', however I receive a compilation error every time the statement is run.

The error code is 00103, “Encountered a ; when expected …..”

then a list of many punctuation marks. From researching the problem I have seen references to a DECLARE statement, however I am not sure I would need to declare if the Prog_Type is created in the Program_Table, and I have reference that table in the trigger.

CREATE OR REPLACE TRIGGER Prog_Made_Limits
BEFORE INSERT OR UPDATE OF Prog_Made ON Program_Table
 FOR EACH ROW
  WHEN (NEW.Prog_Type <> 'FILM')
BEGIN
  IF (:new.Prog_Made < date '1864-12-31' or 
      :new.Prog_Made > sysdate );
  THEN
    RAISE_APPLICATION_ERROR( -20001, 'Program Made date must be later than Dec 31st 1864, and earlier than today, if FILM is inserted');
  END IF;
END Prog_Made_Limits;
/
  • 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-06-18T14:32:34+00:00Added an answer on June 18, 2026 at 2:32 pm

    Your syntax almost fine, but you have a ; after your IF condition which is causing the error. ; is used to separate statements and consequent of your If is part of the the same statement as the condition.

    This should work:

    CREATE OR REPLACE TRIGGER Prog_Made_Limits
    BEFORE INSERT OR UPDATE OF Prog_Made ON Program_Table
     FOR EACH ROW
      WHEN (NEW.Prog_Type <> 'FILM')
    BEGIN
      IF (:new.Prog_Made < date '1864-12-31' or 
          :new.Prog_Made > sysdate )
      THEN
        RAISE_APPLICATION_ERROR( -20001, 'Program Made date must be later than Dec 31st 1864, and earlier than today, if FILM is inserted');
      END IF;
    END Prog_Made_Limits;
    

    I say should, because I don’t have Oracle on my laptop, so can only test on SQL Fiddle, but by removing all semicolons I was able to get this to compile, however I think SQL-Fiddle treats semicolons as batch breaks rather than statement breaks, so I am not sure it is necessary to remove them all.

    Example on SQL Fiddle

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

Sidebar

Related Questions

I am trying to create a BEFORE INSERT trigger that will check the incoming
So, I'm trying to create a trigger that will throw an error on inserting
I'm trying to create a trigger that will fire if the Prog_Type = 'EPISODE'
I'm trying to create a trigger that will allow only one record in a
I'm trying to create a trigger that will do the following. After insert on
I am trying to create a trigger function in PostgreSQL that should check records
I am trying to create a Trigger that will run through some IF ELSEIF
I am trying to create a trigger that will update a GEOMETRY column based
Possible Duplicate: Reset JavaScript Counter? I'm trying to create a function that will trigger
I'm trying to create a trigger that will update my Orders Table with the

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.