Subject Re: Can I delete a row that is the subject of a query that is deleting it??
Author mlq97
Can you be a bit more specific?


--- In firebird-support@yahoogroups.com, Hans <hhoogstraat@...> wrote:
>
> Maybe the use of a CURSOR ?
>
> ----- Original Message -----
> From: "Adam" <s3057043@...>
> To: <firebird-support@yahoogroups.com>
> Sent: Thursday, February 15, 2007 4:15 PM
> Subject: [firebird-support] Re: Can I delete a row that is the
subject of a
> query that is deleting it??
>
>
> > --- 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
> >
> >
> >
> >
> > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> >
> > Visit http://www.firebirdsql.org and click the Resources item
> > on the main (top) menu. Try Knowledgebase and FAQ links !
> >
> > Also search the knowledgebases at http://www.ibphoenix.com
> >
> > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
>