Index: trunk/MagicSoft/Mars/datacenter/macros/checkstardone.C
===================================================================
--- trunk/MagicSoft/Mars/datacenter/macros/checkstardone.C	(revision 7042)
+++ trunk/MagicSoft/Mars/datacenter/macros/checkstardone.C	(revision 7042)
@@ -0,0 +1,91 @@
+/* ======================================================================== *\
+!
+! *
+! * This file is part of MARS, the MAGIC Analysis and Reconstruction
+! * Software. It is distributed to you in the hope that it can be a useful
+! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
+! * It is distributed WITHOUT ANY WARRANTY.
+! *
+! * Permission to use, copy, modify and distribute this software and its
+! * documentation for any purpose is hereby granted without fee,
+! * provided that the above copyright notice appear in all copies and
+! * that both that copyright notice and this permission notice appear
+! * in supporting documentation. It is provided "as is" without express
+! * or implied warranty.
+! *
+!
+!
+!   Author(s): Daniela Dorner, 05/2005 <mailto:dorner@astro.uni-wuerzburg.de>
+!
+!   Copyright: MAGIC Software Development, 2000-2005
+!
+!
+\* ======================================================================== */
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// checkstardone.C
+// ===============
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#include <iostream>
+#include <iomanip>
+#include <fstream>
+
+#include <TEnv.h>
+
+#include <MSQLServer.h>
+#include <TSQLRow.h>
+#include <TSQLResult.h>
+
+using namespace std;
+
+
+TString GetStatus(MSQLServer &serv, TEnv &rc, TString primary, TString table, TString column)
+{
+    TString query(Form("SELECT %s FROM MyMagic.%s WHERE %s=%s",
+                       column.Data(), table.Data(),
+                       rc.GetValue(table+".Primary", ""),
+                       primary.Data()));
+
+    cout << "Query: " << query << endl;
+
+    TSQLResult *res = serv.Query(query);
+    if (!res)
+    {
+        cout << "Error - no run to check" << endl;
+        return "";
+    }
+
+    TSQLRow *row=0;
+    while ((row = res->Next()))
+        return (*row)[0];
+
+    return "";
+}
+
+int checkstardone(TString datasetno)
+{
+    TEnv env("sql.rc");
+
+    MSQLServer serv(env);
+    if (!serv.IsConnected())
+    {
+        cout << "ERROR - Connection to database failed." << endl;
+        return 0;
+    }
+    cout << "checkstardone" << endl;
+    cout << "-------------" << endl;
+    cout << endl;
+    cout << "Connected to " << serv.GetName() << endl;
+    cout << endl;
+
+    TEnv rc("steps.rc");
+
+    if (GetStatus(serv, rc, datasetno, "SequenceProcessStatus", "fStar")=="")
+        return 0;
+
+    return 1;
+}
+
Index: trunk/MagicSoft/Mars/datacenter/macros/setupdb.C
===================================================================
--- trunk/MagicSoft/Mars/datacenter/macros/setupdb.C	(revision 7039)
+++ trunk/MagicSoft/Mars/datacenter/macros/setupdb.C	(revision 7042)
@@ -545,5 +545,5 @@
          "  fDataSetNumber    INT       UNSIGNED   PRIMARY KEY, "
          "  fDataSetInserted  DATETIME             NULL,"
-         "  fFilesAvail       DATETIME             NULL,"
+         "  fStarFilesAvail   DATETIME             NULL,"
          "  fGanymed          DATETIME             NULL"
          ")";
@@ -575,5 +575,5 @@
          "  fSequenceFirst         INT       UNSIGNED   PRIMARY KEY, "
          "  fSequenceFileWritten   DATETIME             NULL,"
-         "  fFilesAvail            DATETIME             NULL,"
+         "  fAllFilesAvail         DATETIME             NULL,"
          "  fCallisto              DATETIME             NULL,"
          "  fFillCallisto          DATETIME             NULL,"
