Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: How to Get Every two weeks settlement --allways Wednesday

Re: How to Get Every two weeks settlement --allways Wednesday

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Fri, 28 Jul 2006 22:59:18 +0200
Message-ID: <dbukc2d8l2vermr8d3pk8taga7hs9ahvkf@4ax.com>


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 DBA
Received on Fri Jul 28 2006 - 15:59:18 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US