Using ODBC and other database interfaces with Mosel: Data exchange with spreadsheets and databases

File uploaded by on Aug 8, 2014
Version 1Show Document
  • View in full screen mode

This document gives an introduction to the available Mosel interfaces for accessing databases and spreadsheets

from within a model. It provides a large number of examples illustrating topics such as sparse and dense data

formats, tables holding entries of several data arrays, data arrays read in from several tables, use of the data

structures ’list’ and ’record’, and the handling of dates and time data.

The ODBC protocol is supported by many database software products. Data may be transfered between a

model and an external (ODBC) data source through initializations blocks, using the odbc IO driver, or with

the help of SQL commands. The latter option provides greater flexibility but requires some knowledge of the

SQL language.

The software-specific interface for working with Oracle databases defined by the module mmoci is very similar

to the ODBC interface (IO driver and SQL)—the differences are explained by indicating the necessary modifications

to the examples.

This paper also discusses the spreadsheet interfaces defined by the module mmsheet, namely the direct,

software-specific access to Excel spreadsheets via the IO driver excel, the more generic xls and xlsx drivers,

and the interface to CSV format data.