Subject Re: error in trigger
Author duilio_fos <irel_llc@libero.it>
Milan,

> select /* 1 */
> n_doc,
> d_doc,
> serie,
> d_mag,
> cod_age,
> cod_dst
> from bl_hd
> where bl_hd.y_mov=bl_lt.y_mov and bl_hd.n_mov=bl_lt.n_mov /*2*/
> into
> :n_doc,
> :d_doc,
> :serie,
> :d_mag,
> :cod_age,
> :cod_dst;

> I guess that primary key for table bl_hd is (y_mov, n_mov), is it?

right

>Have you checked how many rows this select returns?

the "multiple rows..." error is raised and this means that 2 or more
rows are returned.

A further check shows that the error is raised _only when_ the row
(2002,N) exists and the row (2003,N) must be inserted.

However, the code seems correct, because the WHERE statement /* 2 */
says to take only row (2003,N), so only 1 row should be returned.

This is the mistery that needs a solution.

Thank you

Duilio Foschi