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

Description

Store data from Access database (file Transportation.accdb) 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.accdb  SQL2GDX2.gms

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

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

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

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

$callTool win32.msappavail Access
$if errorlevel 1 $abort.noError "No Access available"

$onEcho > howToRead.txt
C=DRIVER=Microsoft Access Driver (*.mdb, *.accdb);dbq=.\Transportation.accdb
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!