How to display all Friday's in a year with date?

Answer Posted / dinesh

CREATE OR REPLACE PROCEDURE display_day_date(c date,d date,v varchar2) IS
a number(10);
m date:=c;
BEGIN
a:=d-m;
FOR i in 1..a
LOOP
IF to_char(m,'DY')= v THEN
DBMS_OUTPUT.PUT_LINE('THIS IS'||' '|| v ||' ' || 'DATE for the year '||' '||to_char(m,'yyyy')|| ' '|| m);
END IF;
m:=m+1;
END loop;
END;

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to avoid duplicate records in a query?

588


What is difference between rank () row_number () and dense_rank () in sql?

590


What are the features of pl sql?

575


Is pl sql a scripting language?

601


how to include comments in sql statements? : Sql dba

553






What are the sql commands?

619


what happens when the column is set to auto increment and you reach the maximum value for that table? : Sql dba

585


Which join is like inner join?

572


How can you fetch common records from two tables?

597


how many ways to get the current time? : Sql dba

544


how to start mysql server? : Sql dba

626


What is meant by user defined function?

595


What is online transaction processing (oltp)?

607


What is sql scripting?

571


What is a sql instance vs database?

586