Subject Re: Can I delete a row that is the subject of a query that is deleting it??
Author Adam
--- In firebird-support@yahoogroups.com, "mlq97" <mlq@...> wrote:
>
> Can I delete a row that is the subject of a query that is deleting it??
> If not, how can I do this? It doesn't seem to work and I am wondering
> if it is intrinsically impossible or whether there is some other
problem.
>
> For example:
>
> BEGIN
> FOR SELECT docline.docline_id
> FROM docline
> INTO :v_docline_id
> /* where etc */
>
> DO BEGIN
> DELETE from docline
> WHERE
> docline.docline_id = :v_docline_id;
> END
> END
>

From memory you can. Maybe check your where clause. A simple way to
check is to move v_docline_id to an output parameter, put a suspend in
the loop and call it with the select (not usually a good practice,
just a debug suggestion) to make sure you are actually getting the
rows you think.

Adam