Subject Re: Update only First 10 problem ?
Author Lionel
When I say that work in stored procedure, I want say :

DECLARE VARIABLE iCount INTEGER;
BEGIN
iCount = 0;
FOR
SELECT ID_TEST
FROM TB_TEST
INTO
:RE_ID_TEST
DO
BEGIN
UPDATE TB_TEST SET COL = '123'
WHERE ID_TEST = :RE_ID_TEST;
iCount = iCount + 1;
IF (iCount < 10) THEN
SUSPEND;
ELSE
EXIT;
END

Thank you for your answer, if you have a solution ...
I tried with the other tables and it is the same result, all records
are updated. :(



--- In firebird-support@yahoogroups.com, "Alan McDonald" <alan@m...>
wrote:
> > Sorry, I also write query with ORDER BY and it's the same
result,
> > all the recordings are updated and not only 10 first ones
> >
> > UPDATE TB_TEST SET COL='123'
> > WHERE ID_TEST IN (
> > SELECT FIRST 10 ID_TEST
> > FROM TB_TEST
> > ORDER BY ID_TEST ASC)
> >
> > The subquery return the first 10 records ...
> >
> > I've write this query with EMS and IBExpert and same result.
>
> I see no reason for it not to work.
> You say it works in the SP.. let's see the SP code.
> I can only think that it's a data issue.
> Alan