Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: FIFO in Oracle
In article <887209942.1900544018_at_dejanews.com>, ketanindia_at_hotmail.com wrote:
>Hi Micheal,
>I suggest u 2 different ways -
>
>1. The FIFO table should have a column which will be populated by the
>sequence. And there will be an index on this column. Let's say we call
>> Our company is going to develop an Oracle application that requires to
>> store requests in a database table (let's name in DB Queue) and later on
>> another server program will pick up the requests and process in a FIFO
>> fashion.
>>
>> The question is how can I do it in Oracle efficiently. It seems to me the
>> server need to read all the requests and sort by time stamp when every
>> time the server program is free to do something.
>>
I think the "best" method would be to key your requests with an Oracle sequence and fetch with a where clause "key_field > 0", this will use the index, no sorting. Then delete the request. This will provide the FIFO processing.
HTH
James
-- lorenzen_at_visi.com | Life is complex; it has | real and imaginary partsReceived on Tue Feb 17 1998 - 00:00:00 CST