Index: trunk/FACT++/src/fits2sql.cc
===================================================================
--- trunk/FACT++/src/fits2sql.cc	(revision 19151)
+++ trunk/FACT++/src/fits2sql.cc	(revision 19152)
@@ -513,8 +513,8 @@
             query += "   `"+name;
             if (N>1)
-                query += "["+to_string((long long int)i)+"]";
+                query += "["+to_string(i)+"]";
             query += "` "+sqltype;
             if (col.type=='A')
-                query += '('+to_string((long long int)col.num)+')';
+                query += '('+to_string(col.num)+')';
             query += " NOT NULL COMMENT '"+ic->first;
             if (!col.unit.empty())
@@ -549,4 +549,15 @@
     Database connection(uri);
 
+    try
+    {
+        if (!force)
+            connection.connected();
+    }
+    catch (const exception &e)
+    {
+        cerr << "SQL connection failed: " << e.what() << '\n' << endl;
+        return 4;
+    }
+
     if (verbose>0)
     {
@@ -571,15 +582,4 @@
             return 6;
         }
-    }
-
-    try
-    {
-        if (!force)
-            connection.connected();
-    }
-    catch (const exception &e)
-    {
-        cerr << "SQL connection failed: " << e.what() << '\n' << endl;
-        return 4;
     }
 
@@ -714,5 +714,5 @@
                 query += "   `"+c->column+"`";
             else
-                query += "   `"+c->column+"["+to_string((long long int)i)+"]`";
+                query += "   `"+c->column+"["+to_string(i)+"]`";
 
             if (N>1 && i!=N-1)
Index: trunk/FACT++/src/root2sql.cc
===================================================================
--- trunk/FACT++/src/root2sql.cc	(revision 19151)
+++ trunk/FACT++/src/root2sql.cc	(revision 19152)
@@ -545,5 +545,5 @@
             query += "   `"+name;
             if (N>1)
-                query += "["+to_string((long long int)i)+"]";
+                query += "["+to_string(i)+"]";
             query += "` "+sqltype+" NOT NULL COMMENT '"+o->GetTitle()+"'";
             if (N>1 && i!=N-1)
@@ -750,5 +750,5 @@
                 query += "   `"+c->column+"`";
             else
-                query += "   `"+c->column+"["+to_string((long long int)i)+"]`";
+                query += "   `"+c->column+"["+to_string(i)+"]`";
 
             if (N>1 && i!=N-1)
