help-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-glpk] RE: Error when using "table"


From: glpk xypron
Subject: Re: [Help-glpk] RE: Error when using "table"
Date: Tue, 15 Feb 2011 21:11:22 +0100

Hello Marc,

> Question 2:  Just to play it safe, I tried to create a fourth "table"
> statement with the DELETE FROM sql in it, and run that first at the 
> beginning. 
> Except that it does not work.  Specifically I tried (after finding
> something that syntactically works):
> 
>     table result2 {x in EMPTY_TYPES : x=""} # this is the null set, no
> string in EMPTY_TYPES is blank
>         OUT 'ODBC'
>       'Driver={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=' &
> DB_LOCATION & ';'
>       'DELETE FROM fc_ForecastEmpties;' : 1~ID;
> But it did not delete the records, and the GLPSOL output says:
> 
>     Writing result2...
>     Connected to ACCESS 04.00.0000 - C:\Forecast.mdb
>     INSERT INTO DELETE FROM tbl_result; ( ID ) VALUES ( ? )

glpk-4.45\doc\gmpl.pdf teaches:
"For OUT-table the last SQL statement can contain one or multiple ques-
tion marks. If it contains a question mark it is considered a template for the 
write routine. Otherwise the string is considered a table name and an INSERT 
template is automatically generated."

As you used an empty set in the domain the syntactically wrong INSERT was never 
executed. That is why Access did not return an error.

A reasonable use of DELETE might be:

table result2 {x in {1,2,3}} OUT 'ODBC'
  'Driver={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=' & DB_LOCATION & ';'
  'DELETE FROM fc_ForecastEmpties WHERE ID = ?' :
  x;

Best regards

Xypron

-- 
GMX DSL Doppel-Flat ab 19,99 Euro/mtl.! Jetzt mit 
gratis Handy-Flat! http://portal.gmx.net/de/go/dsl



reply via email to

[Prev in Thread] Current Thread [Next in Thread]