SQL2GDX2.gms : Creates a GDX File using SQL2GMS at compile Time

Description

Store data from Access database (file Transportation.mdb) into a GDX file.

This model is referenced in section "Strategies" from the SQL2GMS Documentation.

Keywords: SQL2GMS, data exchange, GAMS language features


Category : GAMS Data Utilities library


Main file : SQL2GDX2.gms   includes :  Transportation.mdb  SQL2GDX2.gms

$title Creates a GDX File using SQL2GMS at compile Time (SQL2GDX2,SEQ=056)

$onText
Store data from Access database (file Transportation.mdb) into a GDX file.

This model is referenced in section "Strategies" from the SQL2GMS Documentation.

Keywords: SQL2GMS, data exchange, GAMS language features
$offText

$if %system.filesys% == UNIX $abort.noError 'This model cannot run on a non-Windows platform';

$onEcho > howToRead.txt
C=Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Transportation.mdb
X=Transportation.gdx

Q1=SELECT name FROM suppliers
S1=i

Q2=SELECT name FROM demandcenters
S2=j

Q3=SELECT name, demand FROM demandcenters
A3=demand

Q4=SELECT name, supply FROM suppliers
A4=supply

Q5=SELECT supplier, demandcenter, distance FROM distances
A5=dist
$offEcho

$call sql2gms.exe @howToRead.txt > %system.nullfile%
$ifE errorLevel<>0 $abort Error using SQL2GMS!