Logo ROOT  
Reference Guide
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Loading...
Searching...
No Matches
sqlcreatedb.py
Go to the documentation of this file.
1## \file
2## \ingroup tutorial_sql
3## \notebook -nodraw
4## Create a runcatalog table in a MySQL test database.
5##
6## Based on the code sqlcreatedb.C by Sergey Linev
7##
8## \macro_code
9##
10## \author Juan Fernando Jaramillo Botero
11
12from ROOT import TSQLServer
13
14
15# read in runcatalog table definition
16fp = open("runcatalog.sql", "r")
17sql = fp.read()
19
20# open connection to MySQL server on localhost
21db = TSQLServer.Connect("mysql://localhost/test", "nobody", "")
22
23# create new table (delete old one first if exists)
24res = db.Query("DROP TABLE runcatalog")
25
26res = db.Query(sql)
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.