Sunday, August 16, 2015

Oracle forms get WEEK DAYS

PROCEDURE GET_YWEEKDAYS(P_WORK_DATE IN DATE,
                          P_DAY_NAME  IN OUT VARCHAR2) 
IS
BEGIN
 DECLARE
  TXT NUMBER(1);
 BEGIN
   TXT := TO_NUMBER(TO_CHAR(P_WORK_DATE,'D'));
if :global.direction =1 then
   if     TXT = 7 
   then 
      P_DAY_NAME := 'ÇáÓÈÊ';
   elsif  TXT = 1 
   then 
      P_DAY_NAME := 'ÇáÇÍÏ';
   elsif  TXT = 2
   then 
      P_DAY_NAME := 'ÇáÇËäíä';
   elsif  TXT = 3
   then 
      P_DAY_NAME := 'ÇáËáÇËÇÁ';
   elsif  TXT = 4
   then 
      P_DAY_NAME := 'ÇáÇÑÈÚÇÁ';
   elsif  TXT = 5
   then 
      P_DAY_NAME := 'ÇáÎãíÓ';
   elsif  TXT = 6
   then 
      P_DAY_NAME := 'ÇáÌãÚå';  
   end if;
else
   if     TXT = 7 
   then 
      P_DAY_NAME := 'Saturday';
   elsif  TXT = 1 
   then 
      P_DAY_NAME := 'Sunday';
   elsif  TXT = 2
   then 
      P_DAY_NAME := 'Monday';
   elsif  TXT = 3
   then 
      P_DAY_NAME := 'Tuesday';
   elsif  TXT = 4
   then 
      P_DAY_NAME := 'Wednesday';
   elsif  TXT = 5
   then 
      P_DAY_NAME := 'Thursday';
   elsif  TXT = 6
   then 
      P_DAY_NAME := 'Friday';  
   end if;

end if;

No comments:

Post a Comment