On 02 Nov 2004 11:11:46 +0100, Harald Fuchs <[EMAIL PROTECTED]> wrote:
> In article <[EMAIL PROTECTED]>,
> 
> I guess this is an oversimplification.  Often you can use a single SQL set
> operation instead of a loop.  Your example would probably be the same as
> 
>   UPDATE packet
>   SET timestamp = now()
>   WHERE timestamp < now() - INTERVAL 15 SECOND
> 
> Maybe you should explain what you're trying to achieve, not what you
> think how to do it.

Sure.  I am using MySQL to store packets for transmission.  I want to
send the oldest, highest priority packets first.  Once I send it, I
don't want to resend it for at least 15 seconds so I have time to wait
for an acknowlegement.  Based on external events, I may exit the loop
before processing all the rows.  In this case, I only want to update
the timestamp on rows that I processed.  Any rows that I haven't
processed yet should keep the old timestamp.

...Stephen

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to