ROOT
Version v6.34
master
v6.32
v6.30
v6.28
v6.26
v6.24
v6.22
v6.20
v6.18
v6.16
v6.14
v6.12
v6.10
v6.08
v6.06
Reference Guide
►
ROOT
•
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
12
from
ROOT
import
TSQLServer
13
14
15
# read in runcatalog table definition
16
fp = open(
"runcatalog.sql"
,
"r"
)
17
sql =
fp.read
()
18
fp.close
()
19
20
# open connection to MySQL server on localhost
21
db =
TSQLServer.Connect
(
"mysql://localhost/test"
,
"nobody"
,
""
)
22
23
# create new table (delete old one first if exists)
24
res =
db.Query
(
"DROP TABLE runcatalog"
)
25
26
res =
db.Query
(sql)
TRangeDynCast
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Definition
TCollection.h:358
tutorials
sql
sqlcreatedb.py
ROOT tags/v6-34-08 - Reference Guide Generated on Tue Apr 8 2025 05:25:16 (GVA Time) using Doxygen 1.10.0