On 31-10-2018 17:05, Issam Boughanmi amigof...@gmail.com [firebird-support] wrote: > > > @Karol : > > there is 3 fields : > v*A*num : primar key > vInumĀ + ancode : composite unique index . > > this is a little wierd to me : > if the matching is based on the primary key , normally on the execution > when the record is found it will update right and not insert a new one?
Yes, but you don't take into account the situation where the combination of vInum + ancode already exists. > also like i said if i run this same query as a standalone outside the SP > it run fine .. Please provide a reproducible example. Mark -- Mark Rotteveel