Prerequisite : PL/SQL Introduction
PLSQL stands for “Procedural Language extensions to SQL” and is used to transform, update and query data in a database. It is grouped into blocks that contain the declaration and statements. And it is integrated with the oracle database (since version 7). And the main idea behind PLSQL is that it adds some programming constraints that are not available in SQL.
In PLSQL NEXT_DAY Function is used to return the first weekday that is greater than the given date. So this function will take the input from the user that is the date and the weekday and then it will return the date which is greater than the given date according to the weekday.
And this function is Supported in Oracle 11g, Oracle 12c, Oracle 10g, Oracle 9i.
DATE – The date value which is used to find the next weekday.
WEEKDAY -It is the day of the week which we want to return.
RETURNS – It returns the first date greater than the given date according to the weekday.
The weekday accepts the following Weekday from the table given below –
||The first Sunday later than a date
||The first Monday later than a date
||The first Tuesday later than a date
||The first Wednesday later than a date
||The first Thursday later than a date
||The first Friday later than a date
||The first Saturday later than a date
Example 1 –
NEXT_DAY( DATE '2000-01-01', 'SUNDAY' ) as NEXT_DATE
Example 2 –
Example 3 –
SELECT NEXT_DAY(SYSDATE,'MONDAY') AS NEXT_MONDAY
Unlock the Power of Placement Preparation!
Feeling lost in OS, DBMS, CN, SQL, and DSA chaos? Our Complete Interview Preparation
Course is the ultimate guide to conquer placements. Trusted by over 100,000+ geeks, this course is your roadmap to interview triumph.
Ready to dive in? Explore our Free Demo Content and join our Complete Interview Preparation