[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-glpk] Problem Table OUT GLPK Excel
From: |
xypron |
Subject: |
Re: [Help-glpk] Problem Table OUT GLPK Excel |
Date: |
Thu, 30 May 2013 06:31:41 -0700 (PDT) |
Bonjour Julien,
please, read
http://support.microsoft.com/kb/178717
<cite>
The driver will not support DELETE, UPDATE, or ALTER TABLE statements. While
it is possible to update values, DELETE statements will not remove a row
from a table based on an Excel spreadsheet. These operations are not
supported. Basically, you can only append (insert) to a table.
</cite>
Cordialement
Heinrich Schuchardt
julien lecoq wrote:
>
> Hi everybody,
> I started with GLPK and I have a problem with Excel.
> First, here is my test program :
> <set P; /*Définition de l'ensemble P*/param B {p in P};
> /*Définition du paramètre B dans l'ensemble P*/param C {p in P};
> /*Définition du paramètre C dans l'ensemble P*/
>
> table Test1 IN 'ODBC' /*Définition de la table d'importation Test1
> (qui peut avoir n'importe quel nom)*/ 'DRIVER={Microsoft Excel Driver
> (*.xls)};dbq=.\Test.xlsx' /*Appel du driver Excel*/ 'SELECT * FROM
> [Test1$]': /*Sélection de la feuille du fichier Excel*/P <- [Produit],
> B, C; /*Définition des paramètre à importer d'Excel*/
>
> var D {p in P}; /*Définition de la variable D dans l'ensemble P*/var E
> {p in P}; /*Définition de la variable E dans l'ensemble P*/
>
> s.t. c1 {p in P} : D[p] = B[p]; /*Contrainte pour recopier le
> paramètre B dans la variable D*/s.t. c2 {p in P} : E[p] = C[p];
> /*Contrainte pour recopier le paramètre C dans la variable E*/
>
> solve; /*Appel du solver*/
>
> table Test2 {p in P} OUT "ODBC" /*Définition de la table d'exportation
> Test1 (qui peut avoir n'importe quel nom)*/ 'DRIVER={Microsoft Excel
> Driver (*.xls)};READONLY=FALSE; dbq=.\Test.xlsx' /*Appel du driver
> Excel*/
>
> /*Le . de .\Test.xlsx signifie que le fichier Excel est dans le même
> dossier que le fichier GLPK*/ 'UPDATE [Test2$] set D = '''';' /*Mise
> à jour de l'ensemble de la variable D de la feuille Test2*/ 'UPDATE
> [Test2$] set E = '''';' /*Mise à jour de l'ensemble de la variable E
> de la feuille Test2*/ 'INSERT INTO [Test2$]' /*Insertion dans la
> feuille Test2*/ '(D,E)' /*Appel des variables à modifier*/
> 'VALUES(?,?);': /*Nombre de valeurs à exporter, autant que de ?*/
> D[p], E[p]; /*Définition des valeurs à exporter*/
>
> end; /*Déclaration de fin de programme*/>
> It works fine but the "table OUT" makes a new lines in Excel everytimes I
> compile the program.
> I already tried DELETE FROM and WHERE .=. but I think I didn't write well.
>
> Sorry for my English ... and thank you in advance.
> Regards,Loustic100
>
>
>
> _______________________________________________
> Help-glpk mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/help-glpk
>
>
--
View this message in context:
http://old.nabble.com/Problem-Table-OUT-GLPK-Excel-tp35565374p35570920.html
Sent from the Gnu - GLPK - Help mailing list archive at Nabble.com.