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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T07:51:50+00:00 2026-06-04T07:51:50+00:00

Trying to get Oracle to Get a date set it to year only and

  • 0

Trying to get Oracle to Get a date set it to year only and compare to a value inserted or updated into my database before hand
This is what I have tried so far. But I seem to be stuck
Any assistance would be great, Thanks

create or replace
TRIGGER CHECK_YEAR_DIFF
BEFORE INSERT OR UPDATE OF YEAROFPERSON ON PERSON 
FOR EACH ROW 

Currentdate Date; 
Playeryrborn_Var Integer;

Begin

Currentdate := TRUNC(Sysdate,'YYYY');
YEAROFPERSON_var := new.YEAROFPERSON;

  IF (currentDate - YEAROFPERSON_var <= 40) AND (currentDate - YEAROFPERSON_var => 16) THEN 

  dbms_Output.Put_Line('Year of Birth Updated Successfully');

  ELSE

  dbms_output.put_line('Year of Birth Failed to Successfully Update');

  END IF;

END;
  • 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-04T07:51:52+00:00Added an answer on June 4, 2026 at 7:51 am

    IF (currentDate – YEAROFPERSON_var <= 40) AND (currentDate – YEAROFPERSON_var => 16)

    replace with the following

    IF (currentDate – YEAROFPERSON_var <= 40) AND (currentDate – YEAROFPERSON_var >= 16)

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

Sidebar

Related Questions

I am trying to input a date into an Oracle database. Sometime this value
Trying to insert 315K Gif files into an Oracle 10g database. Everytime I get
I' trying to get some data from Oracle via ODBC to mySQL database. And
I am trying to insert a record into an Oracle database I have a
I'm trying to get some data from a remote Oracle Database, so I configured
Hi I am trying to get information on an Oracle package directly from PHP
Am working on web Services... and am a beginner, Am trying to get Oracle
I've got a oracle 10g PL/SQL program that I'm trying to get to run,
I'm trying to build a query from an Oracle 11g database to use in
I am trying to get unique values from a table in oracle via sql.

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.