@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? also like i said if i run this same query as a standalone outside the SP it run fine .. hope it make sense .