convert query from sql to oracle

I have the following SQL query:

SELECT
@weekenddtm = CONVERT(VARCHAR,DATEADD(DD,(7 - DATEPART(DW,@p_end_dtm)),@p_end_dtm),111)

and I tried converting it into oracle using this query:

v_weekenddtm   := CAST(p_end_dtm + NUMTODSINTERVAL((7-TO_NUMBER(TO_CHAR(p_end_dtm,'D'))),'DAY')  AS DATE);

,but it is giving me error. Any idea how to go ahead?

Answers


What are the datatypes of p_end_dtm and v_weekend_dtm? Your code works if they are as follows:

declare
   p_end_dtm timestamp;
   v_weekend_dtm date;
begin
   v_weekend_dtm := CAST(p_end_dtm+ NUMTODSINTERVAL((7-TO_NUMBER(TO_CHAR(p_end_dtm,'D'))),'DAY')  AS DATE);
end;

Need Your Help

cannot login to phpmyadmin error #1862 - Your password has expired

mysql login phpmyadmin

I installed mysql, php and phpmyadmin following this tutorial. Evrything works well, i.e., I can start and connect to mysql through the command line without any error, but the problem is when I try...