help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] Problems with Connecting GLPK to Excel


From: glpk xypron
Subject: Re: [Help-glpk] Problems with Connecting GLPK to Excel
Date: Tue, 27 Jul 2010 22:54:48 +0200

Hello Aly,

the model below shows the correct syntax.

READONLY=FALSE is only needed for Excel not for Access.

In the table OUT statement a domain specifies over which
entries you iterate.

The last SQL statement is executed once per domain
entry.

All question marks in this last SQL statement are replaced
by the variables given after the colon.

Best regards

Xypron



set TF := { 'tf1', 'tf2', 'tf3' };
set P  := { 'p1', 'p2', 'p3'};
set T  := { 't1', 't2'};
param iq{TF, P, T} := Uniform01();

solve;

table t {j in TF, p in P, t in T} OUT 'ODBC'
  'FileDSN=.\d2.dsn'
  'UPDATE TransformerTypeStoragePeriodProducts'
  '  SET StorageQuantity = ?'
  '  WHERE TransformerTypeID = ?'
  '    AND PeriodID = ?'
  '    AND ProductID = ?' :
  iq[j, p, t], j, t, p;

end;


-------- Original-Nachricht --------
> Datum: Tue, 27 Jul 2010 07:22:00 -0400 (EDT)
> Betreff: Re: [Help-glpk] Problems with Connecting GLPK to Excel

> Hi Xypron,
> 
> Well, I have really tried a lot, but still with no luck.
> 
> The following SQL syntax works fine in Access:
> 
> UPDATE TransformerTypeStoragePeriodProducts SET StorageQuantity = 5
> WHERE TransformerTypeID = 1
> AND PeriodID = 1
> AND ProductID = 1;
> 
> Then, when I try to have this in GLPK:
> 
> table iq_jptyyy {j in TF, p in P, t in T} OUT 'ODBC'
>   'FileDSN=.\d2.dsn;READONLY=FALSE'
> 
> 'UPDATE TransformerTypeStoragePeriodProducts'
> 'SET StorageQuantity = iq[j, p, t]'
> 
> 'WHERE TransformerTypeID = j'
> 'AND PeriodID = t'
> 'AND ProductID = p';
> 
> I get a syntax error saying that a semi colon is missing where expected.
> 
> So, I tried this:
> 
> table iq_jptyyy {j in TF, p in P, t in T} OUT 'ODBC'
>   'FileDSN=.\d2.dsn;READONLY=FALSE'
> 
> 'UPDATE TransformerTypeStoragePeriodProducts'
> 'SET StorageQuantity = iq[j, p, t]'
> 
> 'WHERE TransformerTypeID = j'
> 'AND PeriodID = t'
> 'AND ProductID = p':
> j ~ TransformerTypeID, p ~ ProductID, t ~ PeriodID, iq[j, p, t] ~
> StorageQuantity;
> 
> And that one (and other similar ones) fails to write and the driver
> reports the error 733: "error on writing data to table iq_jptyyy, model
> postsolving error". One of the other ones for instance that gave the same 
> error and
> didn't work for instance is:
> 
> table iq_jptyyy {j in TF, p in P, t in T} OUT 'ODBC'
>   'FileDSN=.\d2.dsn;READONLY=FALSE'
> 
> 'UPDATE TransformerTypeStoragePeriodProducts'
> 'SET StorageQuantity = iq[j, p, t]':
> j ~ TransformerTypeID, p ~ ProductID, t ~ PeriodID, iq[j, p, t] ~
> StorageQuantity;
> 
> 
> 
> Any ideas?
> 
> Thanks a lot for the continuous support, patience and help!! I certainly
> appreciate it!!
> 
> Best,
> 
> Aly

-- 
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01



reply via email to

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