bug-glpk
[Top][All Lists]
Advanced

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

Re: Bug in 'table' statement


From: Heinrich Schuchardt
Subject: Re: Bug in 'table' statement
Date: Tue, 4 Feb 2020 21:18:37 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0

On 2/4/20 8:38 PM, Meketon, Marc via Bug reports for GLPK (GNU Linear
Programming Kit) wrote:
The following code fails when writing out records to a Microsoft Access
database.  You would need to create a table called ‘result’ with a
numeric field called ‘Day’ to run the below (as well as change the
name/path of the database)

param odbc_driver symbolic := 'DRIVER={Microsoft Access Driver (*.mdb,
*.accdb)};dbq=.\data.accdb';

table PUT_RESULTS_1 {d in 1..10} OUT 'ODBC'

   odbc_driver

   'DELETE FROM result; '   # NOTE THE SPACE AFTER THE ;

   'result' :

   d ~ Day

;

The issue is the space after the ‘;’ in the DELETE statement.  If you
took it out, it works.  That is, the following works:

param odbc_driver symbolic := 'DRIVER={Microsoft Access Driver (*.mdb,
*.accdb)};dbq=.\data.accdb';

table PUT_RESULTS_1 {d in 1..10} OUT 'ODBC'

   odbc_driver

   'DELETE FROM result;'  # NOTE THE LACK OF A SPACE

                          #   BETWEEN THE ; and the end-quote

   'result' :

   d ~ Day

;

*Marc Meketon *
Oliver Wyman Digital

sql/mpl/mplsql.c has this description:

*  The arguments passed in dca are SQL statements. A SQL statement may
*  be split over multiple arguments. The last argument of a SQL
*  statement will be terminated with a semicolon. Each SQL statement is
*  merged into a single zero terminated string. Boundaries between
*  arguments are replaced by space.

So you are sending 10 times the following two statements to Access:

"DELETE FROM result"
" "

And Access does the expected: " " is not a valid SQL statement.

This seems consistent to me.

Unfortunately the description of the ODBC driver is missing in doc/gmpl.tex.

@Андрей
There hasn't been any GLPK release since two years. What are your plans?

Best regards

Heinrich



reply via email to

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