Subject execute block where External datasource is localhost :p
Author Issam Boughanmi

i am writing a little .net application that connect to a remote database server hosted on internet to make a sort of replication .

so the database source live in my local firebird server the destination database is on the firebird server hosted on the intenet

here the query

execute block as DECLARE panum INT; DECLARE nom varchar(50); DECLARE prenom 
varchar(50); DECLARE dna date; DECLARE datemodif date; DECLARE VARIABLE VSQL 
VARCHAR(500); begin VSQL = 'select panum, nom, prenom, dna, DATEMODIF from 
patient where (datemodif is not null) and (datediff (day from current_date 
to cast(DATEMODIF as date)) >= 0) ';


FOR execute statement VSQL ON EXTERNAL DATA SOURCE 
'127.0.0.1:C:\BDD\D2018.gdb' 
AS USER 'sysdba' PASSWORD 'masterkey' INTO :panum, :nom, :prenom, :dna, 
:DATEMODIF DO  

merge into patient bb using (select :panum panum, :nom nom, :prenom prenom, 
:dna dna, :DATEMODIF datemodif  from RDB$DATABASE ) n on bb.panum = n.panum 
when matched 
then update set bb.nom = :nom, bb.prenom = :prenom, bb.dna = :DNA, 
bb.DATEMODIF = :DATEMODIF when not matched 
then insert(panum, nom, prenom, dna, datemodif) values(:panum, :nom, 
:prenom, :dna, :datemodif);

suspend;  end; 

both servers run fb3.0.3 on a windows 64 machines .

but it fail saying that it cannot find the host 127.0.0.1 .

 i have also tried localhost and my local ip adress as well .

if i flip the direction so my source database is the remote server and the destination is my local server it works

i know that's a little wierd but i have some constraints for doing it like that

any help is welcome , thanks .