Subject update or insert inside a stored procedure
Author Issam Boughanmi

i have this firebird 2.5 code bloc inside a stored procedure

VSQL = 'select vanum, vinum, ancode, complet,validbio, printed,urgent, 
conclusion from visana  ';
FOR execute statement VSQL ON EXTERNAL DATA SOURCE 'c:\BDD\dynamic.gdb' AS 
USER 'sysdba' PASSWORD 'masterkey' INTO :vanum, :vinum, :ancode, 
:complet, :validbio, :printed, :urgent, :conclusion  DO

update or insert into visana (vanum, vinum, ancode, complet,validbio, 
values (:vanum, :vinum, :ancode, :complet,:validbio, :printed, :urgent, 


the visana table have these indexes : vanum : primary key,

vinum + ancode : composite unique index

when i execute this procedure i have unique index violation exception and flamerobin show me the problematic values .

if i take these values and execute a regular update or insert query with it run without a problem .

any idea on what's going on ?

thanks .