Re: Delete Only 50 rows from table
Posted in 2005
Topics: General Discussion
Serge Rielau said: > Note to OTC: To remove the top-n-rows is a typical opeation on a table > serving as a queue. It's usually a destructive read. > I do follow the why.... Can you spell "bad application design"? -- Bye now, Obnoxio "C'est pas parce qu'on n'a rien ' dire qu'il faut fermer sa gueule" - Coluche "I'm trying to see things your way, but I can't get my head up my ass" - JCH "Ogni uomo mi guarda come se fossi una testa di cazzo" - Marco Travel broadens a person. You look as if you have been all over the world. I went to the airport to check in and they asked what I did because I looked like a terrorist. I said I was a comedian. They said, "Say something funny then." I told them I had just graduated from flying school. -- Ahmed Ahmed http://i2.photobucket.com/albums/y41/Obnoxio/thinkIfoundtheproblem.jpg sending to informix-list
Obnoxio The Chav wrote: > Serge Rielau said: > > >>Note to OTC: To remove the top-n-rows is a typical opeation on a table >>serving as a queue. It's usually a destructive read. >>I do follow the why.... > > > Can you spell "bad application design"? > So hwo do you implement queue and to-do style data? What about an "outstanding orders" table? A staging table in a warehouse? Oustanding tickets in a support center? FIFO is not exactly an esoteric concept in IT. And even if this were "bad design" I have learned to roll with the punches. Can't make customers use the system the way I want it. Cheers Serge -- Serge Rielau DB2 SQL Compiler Development IBM Toronto Lab
Serge Rielau wrote:
> Obnoxio The Chav wrote:
>
>> Serge Rielau said:
>>
>>> Note to OTC: To remove the top-n-rows is a typical opeation on a table
>>> serving as a queue. It's usually a destructive read.
>>> I do follow the why....
>>
>>
>>
>> Can you spell "bad application design"?
>>
> So hwo do you implement queue and to-do style data?
> What about an "outstanding orders" table?
> A staging table in a warehouse?
> Oustanding tickets in a support center?
>
> FIFO is not exactly an esoteric concept in IT.
>
> And even if this were "bad design" I have learned to roll with the
> punches. Can't make customers use the system the way I want it.
How about every table/row has a unique identifier. Once you've worked on a
record in the queue/todo/outstanding orders/ table you delete it immediately
or marked it as done with a column update to a flag column or better a state
column that an be marked as {Entered, InProgress, Completed, Printed,
Picked, Shipped,...) whatever. Then you:
DELETE FROM work_queue where status_col = Shipped;
Art S. Kagel