(!*******************************************************
Mosel Example Problems
======================
file indexeg.mos
````````````````
Using ODBC with dense and sparse format data tables.
- Using 'initializations from' with the odbc driver -
(c) 2008 Fair Isaac Corporation
author: S. Heipcke, 2006, rev. Feb. 2014
*******************************************************!)
model ODBCImpEx
uses "mmodbc"
declarations
A: array(1..3, 1..2) of real
B: array(1..2, 1..3) of real
C: array(1..2, 1..3) of real
D: array(R:range, 1..3) of real
CSTR: string
end-declarations
! CSTR:= 'mmodbc.odbc:indexeg.xls'
CSTR:= "mmodbc.odbc:debug;indexeg.sqlite"
! CSTR:= "mmodbc.odbc:debug;DSN=sqlite;DATABASE=indexeg.sqlite"
setparam("SQLverbose",true)
! Data must be dense - there are not enough columns to serve as index!
initializations from CSTR
A as 'Range3by2'
end-initializations
writeln("\n ===A=== ")
forall(i in 1..3)
writeln("Row(",i,"): ", A(i,1), " ", A(i,2))
! Dense data
initializations from CSTR
B as 'noindex;Range2by3'
end-initializations
writeln("\n ===B=== ")
forall(i in 1..2)
writeln("Row(",i,"): ", B(i,1), " ", B(i,2), " ", B(i,3))
! Indexed data
initializations from CSTR
C as 'Range2by3i'
end-initializations
writeln("\n ===C=== ")
forall(i in 1..2)
writeln("Row(",i,"): ", C(i,1), " ", C(i,2), " ", C(i,3))
! Partially indexed ("rectangular format") data
initializations from CSTR
D as 'RectRange'
end-initializations
writeln("\n ===D=== ")
forall(i in R)
writeln("Row(",i,"): ", D(i,1), " ", D(i,2), " ", D(i,3))
end-model