Hello,

  well, that's not the answer I wanted to get, but I've to deal with
  that fact.

  I've to check wether EXECUTE STATEMENT can execute EXECUTE
  BLOCKs, as the DELETE Statement is build dynamically in a proc.



>  
>  Hi  Björn!
>  
>  I don't think there is any simple way to make a delete with a
> subselect as the only part of a where clause perform great on
> largish tables. That is, using EXECUTE BLOCK (which doesn't exist on
> older Firebird versions) should perform OK:
>  
>  execute block as
>    declare variable id integer;
>  begin
>    for select min(t.Id) FROM test t
>        group by t.reference, t.key
>        having count(*) > 1
>    into :id do
>      delete from test where Id = :id;
>  end
>  
>  HTH,
>  Set
>               

  Björn


-- 
Björn Reimer - RRZE



------------------------------------

------------------------------------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Visit http://www.firebirdsql.org and click the Documentation item
on the main (top) menu.  Try FAQ and other links from the left-side menu there.

Also search the knowledgebases at http://www.ibphoenix.com/resources/documents/ 

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
------------------------------------

Yahoo Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/firebird-support/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/firebird-support/join
    (Yahoo! ID required)

<*> To change settings via email:
    [email protected] 
    [email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo Groups is subject to:
    https://info.yahoo.com/legal/us/yahoo/utos/terms/

Reply via email to