function cancellaDB(IDcentralina,DTcatena,Data_scarico,FileName,conn)

comando = ['delete from ELABDATADISP where UnitName = ''' IDcentralina...
    ''' and ToolNameID = ''' DTcatena ''' and EventDate >= ''' Data_scarico ''' '];

curs = exec(conn,comando);

text = strcat('---Elaborated Data of Chain: ',DTcatena,' deleted starting from date: ',Data_scarico,' during the execution of LastElab function.---');
fileID = fopen(FileName,'a');
fmt = '%s \r';
fprintf(fileID,fmt,text);
fclose(fileID);
        
end