postgresql7.1
select to_char(to_date(:current_date, 'yyyy-mm-dd'), 'D')
as day_of_the_week,
to_char(next_day(to_date(:current_date, 'yyyy-mm-dd')-7, 'SUNDAY'),'YYYY-MM-DD')
as sunday_of_the_week,
to_char(next_day(to_date(:current_date, 'yyyy-mm-dd'), 'Saturday'),'YYYY-MM-DD')
as saturday_of_the_week
from dual