Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 8588)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 8589)
@@ -18,4 +18,11 @@
 
                                                  -*-*- END OF LINE -*-*-
+
+ 2007/06/20 Thomas Bretz
+
+   * msql/MSQLMagic.[h,cc]:
+     - added a new function InsertUpdate
+
+
 
  2007/06/20 Daniela Dorner
Index: /trunk/MagicSoft/Mars/msql/MSQLMagic.cc
===================================================================
--- /trunk/MagicSoft/Mars/msql/MSQLMagic.cc	(revision 8588)
+++ /trunk/MagicSoft/Mars/msql/MSQLMagic.cc	(revision 8589)
@@ -268,4 +268,16 @@
 // --------------------------------------------------------------------------
 //
+// An abbreviation for checking the existance with ExistStr and
+// calling insert or update respectively.
+//
+Int_t MSQLMagic::InsertUpdate(const char *table, const char *col, const char *val, const char *vars)
+{
+    return ExistStr(col, table, val) ?
+        Update(table, vars, Form("%s=%s", col, val)) :
+        Insert(table, vars);
+}
+
+// --------------------------------------------------------------------------
+//
 // An abbreviation for a Dalete-Query.
 //
Index: /trunk/MagicSoft/Mars/msql/MSQLMagic.h
===================================================================
--- /trunk/MagicSoft/Mars/msql/MSQLMagic.h	(revision 8588)
+++ /trunk/MagicSoft/Mars/msql/MSQLMagic.h	(revision 8589)
@@ -49,4 +49,5 @@
     Int_t Update(const char *table, const char *vars, const char *where);
     Int_t Delete(const char *table, const char *where);
+    Int_t InsertUpdate(const char *table, const char *col, const char *val, const char *vars);
 
     void Delete(const Option_t *o) { TObject::Delete(o); }
