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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T08:10:15+00:00 2026-06-18T08:10:15+00:00

If I have a date format DDMM in PL/SQL and I want to validate

  • 0

If I have a date format DDMM in PL/SQL and I want to validate it. What is the correct way to do it?

DD is the day and MM is the moth.

For an example:
0208 - is a valid date
3209 - is not a valid date
0113 - is not a valid date.
  • 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-18T08:10:16+00:00Added an answer on June 18, 2026 at 8:10 am

    You could write a function like this one, for instance:

    create or replace function is_valid(p_val in varchar2)
    return number
    is
      not_a_valid_day   exception;
      not_a_valid_month exception;
      pragma exception_init(not_a_valid_day, -1847);
      pragma exception_init(not_a_valid_month, -1843);
      l_date date;
    begin
      l_date := to_date(p_val, 'ddmm');
      return 1;
    exception
      when not_a_valid_day or not_a_valid_month
      then return 0;
    end;
    
    
    
    SQL> with test_dates(dt) as(
      2    select '0208' from dual union all
      3    select '3209' from dual union all
      4    select '0113' from dual
      5  )
      6  select dt, is_valid(dt) as valid
      7    from test_dates
      8  /
    
    DT        VALID
    ---- ----------
    0208          1
    3209          0
    0113          0
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have date in sting object in following format. dd/mm/yyyy I want to change
I have a Date format: 2009-08-10T16:03:03Z that I want to convert to: @MMM dd,
I have a date in String format, mm/dd/yyyy I want to convert this to
Input Date Format DD-MM-YYYY Example 15-01-2012 I have a booking date stored in Session
I have a textbox with date format dd/MM/yyyy that I want to convert to
I want to know if there's a way to change the date format depending
I have date of Birth of the format 04/08/2010(DD/MM/YYYY) and sql server store of
I have the need to display a date in this format: dd/mm/yyyy. This is
I am have a string named begin_date which contain date in the format dd.mm.yyyy
I have the following date format: 2010-04-15 23:59:59 How would I go about converting

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.