Subject RE: [firebird-support] How to delete the output of this "select first 100 seqno from repl_log where relationno =11 order by seqno"
Author Alan McDonald
> >
> >Doind this:-
> >
> >"delete from repl_log where exists (select first 100 seqno from
> >repl_log where relationno =11 order by seqno) "
> >seems like deleting the who table instead of 100 records that I wanted
> >to delete. Anybody know why?
> >
> >
> >
> Deletion becomes recursive; I'd suggest stored procedure with something
> like
> while counter < 100
> select first 1 keys from repl_log order by seqno into
> :KeyToDelete
> delete from repl_log where key = KeyToDelete
> counter++
>
> Adomas
>

this would be recursive too no? the select fires after every delete. You
need to completely separate the listsof IDs from the delete operation
Alan

>
>
> >* repl_log is a table. relationno and seqno are fields in repl_log table.
> >** I want to delete the first 100 data with relationno = 11
> sorted by seqno