Query a database

Verified
Added by iNTERFACEWARE

Use conn:query() to select data from a table in a database

Source Code
   -- connect to a SQLite database
   conn = db.connect{
      api = db.SQLITE,
      name = 'test',
      live = true
   }   
   
   -- select data from a database table
   local R = conn:query('SELECT * FROM Patient')
   trace(R)
Description
Use conn:query() to select data from a table in a database
Usage Details

Use conn:query() to select data from a table in a database. The code connects to a SQLite database, you can substitute with any database connection.

How to use the snippet:

  • Paste the query code into your script