Home » SQL & PL/SQL » SQL & PL/SQL » problem with dates
problem with dates [message #39647] Tue, 30 July 2002 23:41 Go to next message
bharath
Messages: 30
Registered: November 2000
Member
hai,
My problem is i want to change the date if the day is eithere saturday or sunday to monday;
for this i have written a small procedure and its not working properly
here is it

create or replace procedure for_date(inp in date) is
begin
if to_char(inp,'day') = 'saturday' then
dbms_output.put_line('this is a saturday');
end if;
dbms_output.put_line('nextday is :'||inp+1);
/*i am getting a conversion error*/
dbms_output.put_line(to_Char(inp,'day'));
dbms_output.put_line(inp);
end;
/
it is not entering into the loop
help me please
thanks you in advance
bye
bharath
Re: problem with dates [message #39649 is a reply to message #39647] Wed, 31 July 2002 01:09 Go to previous message
Indrajit Mitra
Messages: 3
Registered: April 2002
Junior Member
create or replace procedure for_date(inp in date) is
dd date;
begin
if to_char(inp,'day') = 'saturday' then
dbms_output.put_line('this is a saturday');
end if;
dd := inp+1;
dbms_output.put_line('nextday is : '||dd);
dbms_output.put_line('Day : '||to_Char(inp,'day'));
dbms_output.put_line('InpValue : '||inp);
end;
Previous Topic: Constraint to force existence in another table?
Next Topic: EXECUTE IMMEDIATE
Goto Forum:
  


Current Time: Thu Mar 28 15:58:31 CDT 2024