Write a pl/sql program to input two dates and print number of Sundays between those two dates.
Before each iteration of the loop, condition is evaluated. If it evaluates to TRUE, sequence_of_statements is executed. If condition evaluates to FALSE or NULL, the loop is finished and control resumes after the END LOOP statements.
The only difference between simple loop and while loop is simple execute first and then it will check condition, so simple loop execute at least once and in while loop first it will check condition and then execute.
Input: Enter value for date1: 01-SEP-19 Enter value for date2: 29-SEP-19 Output: no of Sundays : 5
Input: Enter value for date1: 01-SEP-19 Enter value for date2: 15-SEP-19 Output: no of Sundays: 3
Enter value for date1: 01-SEP-19 old 5: Begin D1:='&Date1'; new 5: Begin D1:='01-SEP-19'; Enter value for date2: 29-SEP-19 old 6: D2:='&Date2'; new 6: D2:='29-SEP-19'; no of Sundays:5
PL/SQL procedure successfully completed.
By using while loop first it checks condition and then execute, So We count easily the number of a special day between two dates.
- PLSQL | LN Function
- PLSQL | LEAST Function
- PLSQL | SIN Function
- Difference between SQL and PLSQL
- PLSQL | CHR Function
- PLSQL : || Operator
- PLSQL | TAN Function
- PLSQL | LOG Function
- PLSQL | EXP Function
- PLSQL | COS Function
- PLSQL | MOD Function
- PLSQL | ABS Function
- PLSQL | UPPER Function
- PLSQL | LENGTH2 Function
- PLSQL | LAST_DAY Function
- PLSQL | LENGTHC Function
- PLSQL | ATAN2 Function
- PLSQL | EXTRACT Function
- PLSQL | ASCIISTR Function
- PLSQL | LENGTHB Function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.