Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: How to Get Every two weeks settlement --allways Wednesday
On 28 Jul 2006 10:17:00 -0700, rjayanth_at_gmail.com wrote:
>Hi,
>
>I am trying to get solution for this. I need to get settlement every
>two weeks and it alwyas happens on "Wednesday"
>
>Example :To Day's Date Jul 19
>
>My output look like this
>
>Date Day
>
>Jul19 Wed
>Aug 2 Wed
>Aug 16 Wed
>Aug 30 Wed
>....so on till End Date which is 30 years
>
>Kindly let me know ASAP
>
>Oracle Version:Oracle 9i, restriction no PL/SQL
>
>
>Regards
>Jay
Three solutions
1 Pipelined function, no table. Not allowed because pl/sql
2 dummy table, populated by an anonymous block
begin
for i in 1 .. ((30*52)/2) loop
insert into foo values (sysdate + 14 * i, to_char(sysdate+14*i,
'day');
end loop;
end;
/
but ... pl/sql
3
insert into foo values (sysdate + 14 * 1, to_char(sysdate+14*1,
'day');
insert into foo values (sysdate + 14 * 2, to_char(sysdate+14*2,
'day');
insert into foo values (sysdate + 14 * 3, to_char(sysdate+14*3,
'day');
etc
No pl/sql, but 750 commands.
Hopefully you see how utterly stupid the restriction is.
-- Sybrand Bakker, Senior Oracle DBAReceived on Fri Jul 28 2006 - 15:59:18 CDT
![]() |
![]() |