I will reform my question because I realised that it was wrong.I will try to ask this as simple as I can:
read file.txt
exec @program //a query
if(@program = 0)
write file.txt + "OK;"
else
write file.txt + "NOK;"
My file.txt will contain:
123; 1;
124; 2;
125; 3;
Presuming my query verifies each of the numbers on the first column and returns 0 if its valid and something else if its not ,how can I tell it if @program = 0 write a OK; in the file at the end of the row and if its something else than 0 it will write NOK; so it will look something like this: