SQLite: Difference between revisions

Line 16: Line 16:


===R===
===R===
Using R, the first step is to install the <tt>RSQLite</tt> package in your R environment, after which you can use code like the following to interact with the SQLite database,
{{File
  |name=test.R
  |lang="r"
  |contents=
library(DBI)
dbase <- dbConnect(RSQLite::SQLite(),"foo.sqlite")
dbDisconnect(dbase)
}}


===Perl===
===Perl===
Line 42: Line 53:
   sqlite3* dbase;
   sqlite3* dbase;


   sqlite3_open("foo.sqlite3",&dbase);
   sqlite3_open("foo.sqlite",&dbase);
   query = "SELECT * FROM " + std::string(argv[1]) + ";";
   query = "SELECT * FROM " + std::string(argv[1]) + ";";
   sqlite3_exec(dbase,query.c_str(),nullptr,nullptr,nullptr);
   sqlite3_exec(dbase,query.c_str(),nullptr,nullptr,nullptr);
Bureaucrats, cc_docs_admin, cc_staff
2,318

edits