ODBC Example

The ODBC Example illustrates the use of Lua scripts for data retrieval from an SQL Server.

Since the ODBC Example depends on some additional requirements, it’s recommended that you follow the more detailed setup instructions provided in the Lua ODBC Example of the Lua Scripting Jumpstarts.
Also see this document for further information on the Lua code of this example.

Installation

To create this example automatically in the system, just run the following Lua script in the Console Display. Make sure to first uncomment the last line of the comments, if you don’t have the 'Examples/Demo Data' structure in you I/O Model, yet.

local exm = require('esi-examples')

-- The ODBC Example builds upon the DemoData for the I/O Model, therefore,
-- if you don't have the 'Examples/Demo Data' structure in the I/O Model yet,
-- uncomment the following command to have the Demo Data also installed:

-- exm:SETUP({{"demodata", "iomodel"}})

exm:SETUP({{"odbc"}})
In Lua Security Mode Restrictive, for the installation script as well as the actual example to work, additional configuration of Lua permissions is required. See Lua Security for background information and examples.