Index: trunk/MagicSoft/Mars/macros/sql/filldotrbk.C
===================================================================
--- trunk/MagicSoft/Mars/macros/sql/filldotrbk.C	(revision 4680)
+++ trunk/MagicSoft/Mars/macros/sql/filldotrbk.C	(revision 4694)
@@ -193,8 +193,5 @@
         TSQLResult *res = serv.Query(query);
         if (!res)
-        {
-            cout << "ERROR: " << query << endl << endl;
             return 0;
-        }
 
         delete res;
Index: trunk/MagicSoft/Mars/macros/sql/filldotrun.C
===================================================================
--- trunk/MagicSoft/Mars/macros/sql/filldotrun.C	(revision 4680)
+++ trunk/MagicSoft/Mars/macros/sql/filldotrun.C	(revision 4694)
@@ -107,8 +107,5 @@
     TSQLResult *res = serv.Query(query);
     if (!res)
-    {
-        cout << "ERROR - Query: " << query << endl;
-        return -1;
-    }
+        return -1;
 
     TSQLRow *row=res->Next();
@@ -134,8 +131,6 @@
     res=serv.Query(query);
     if (!res)
-    {
-        cout << "ERROR - Query: " << query << endl;
-        return -1;
-    }
+        return -1;
+
     delete res;
 
@@ -157,5 +152,5 @@
     if (!fin)
     {
-        cout << "Could not open file " << fname << endl;
+        cout << "Could not open file " << filename << endl;
         return -1;
     }
@@ -379,5 +374,5 @@
         if (!TMath::IsNaN(l2uprate) && TMath::Finite(l2uprate))
             query += Form("fL2RateUnpresc=%d, ", TMath::Nint(l2uprate));
-        query += "fMagicNumberKEY=1";
+        query += "fMagicNumberKEY=1, fExcludedFDAKEY=1";
 
         //cout << query << endl;
@@ -393,8 +388,5 @@
         TSQLResult *res = serv.Query(query);
         if (!res)
-        {
-            cout << query << " - FAILED!" << endl;
             return -1;
-        }
 
         delete res;
@@ -406,5 +398,5 @@
 
 // This tool will work from Period017 (2004_05_17) on...
-void filldotrun(const char *path="/data/MAGIC/Period018/ccdata", Bool_t dummy=kTRUE)
+int filldotrun(const TString path="/data/MAGIC/Period018/ccdata", Bool_t dummy=kTRUE)
 {
     MSQLServer serv("mysql://hercules:d99swMT!@localhost");
@@ -423,22 +415,22 @@
     if (path.EndsWith(".run"))
     {
+        cout << path(TRegexp("CC_.*.run", kFALSE)) << flush;
+        Int_t n = insert(serv, dummy, path);
+        cout << " <" << n << "> " << (dummy?"DUMMY":"") << endl;
+
+        return n<0 ? 0 : 1;
+    }
+
+    MDirIter Next(path, "CC_*.run", -1);
+    while (1)
+    {
+        TString name = Next();
+        if (name.IsNull())
+            break;
+
         cout << name(TRegexp("CC_.*.run", kFALSE)) << flush;
         Int_t n = insert(serv, dummy, name);
         cout << " <" << n << "> " << (dummy?"DUMMY":"") << endl;
 
-        return n<0 ? 0 : 1;
-    }
-
-    MDirIter Next(path, "CC_*.run", -1);
-    while (1)
-    {
-        TString name = Next();
-        if (name.IsNull())
-            break;
-
-        cout << name(TRegexp("CC_.*.run", kFALSE)) << flush;
-        Int_t n = insert(serv, dummy, name);
-        cout << " <" << n << "> " << (dummy?"DUMMY":"") << endl;
-
         if (n<0)
             return 0;
