I have an sqlite3 database which I can interrogate with command lines in macOS.
I would like to interrogate this database in a ROOT macro and would like to know,
how to do that:
What are the necessary lines to insert into the macro?
Can I execute the macro interactively or should I compile, load and run it?
It seems to me that those tutorials are dealing with sqlite databases which were created in a ROOT session.
I have a sqlite3 database already created and filled outside ROOT and would like to read it inside ROOT. How to do that? Or how to convert it into a TSQLFile?
I could incorporate straightforwardly the sqlite example inside ROOT, see attached files.
The only think I don’t know how to transport from the “callback” function the data outside
this function, i.e. to the main body of the program, i.e. printing histograms from the data, etc. Test_sqlite3.C (1.5 KB) Test_sqlite3.txt (3.5 KB)
many thanks for your hints. Unfortunately I have still problem to analyze data in ROOT read from the
sqlite database. I send you here an updated Test_sqlite3.C macro to illustrate the problem.
In this macro I can perfectly read and print the first 10 events in the database (see Test_sqlite3.txt).
However I don’t know how to fill my histogram inside the callback function which read the database.
What I want to do is to fill the histogram TH1F* hTNA with the value read in the 8th column (val8)
of the database (called LEVEE_FINAL). Where should I put and in which form the hTNA->Fill(val8);
Maybe it is explained in the sqlselect.C example, but unfortunately I couldn’t find it.
Elemer Test_sqlite3_update.C (1.7 KB)