Logo ROOT  
Reference Guide
sqlcreatedb.py File Reference

Namespaces

 sqlcreatedb
 

Detailed Description

View in nbviewer Open in SWAN Create a runcatalog table in a MySQL test database.

Based on the code sqlcreatedb.C by Sergey Linev

from ROOT import TSQLServer
# read in runcatalog table definition
fp = open("runcatalog.sql", "r")
sql = fp.read()
fp.close()
# open connection to MySQL server on localhost
db = TSQLServer.Connect("mysql://localhost/test", "nobody", "")
# create new table (delete old one first if exists)
res = db.Query("DROP TABLE runcatalog")
res = db.Query(sql)
Author
Juan Fernando Jaramillo Botero

Definition in file sqlcreatedb.py.

ROOT::Math::detail::open
@ open
Definition: GenVectorIO.h:55
TSQLServer::Connect
static TSQLServer * Connect(const char *db, const char *uid, const char *pw)
The db should be of the form: <dbms>://<host>[:<port>][/<database>], e.g.
Definition: TSQLServer.cxx:61