help-glpk
[Top][All Lists]
Advanced

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

[Help-glpk] Re: Another problem when connecting glpk to Access


From: Aly Megahed
Subject: [Help-glpk] Re: Another problem when connecting glpk to Access
Date: Wed, 1 Sep 2010 19:19:28 +0400

Thanks, Xypron.

I was actually finally able to get this problem solved. Here is the code that 
works, for your and everyone's reference:



table x3_iii {j in TF, k in C, p in P, t in T: x3[j,k,p,t]>0} OUT 'ODBC'
  'FileDSN=.\d2.dsn'


  'UPDATE ((Channels a INNER JOIN ChannelPeriodProducts b'
'ON a.ChannelID = b.ChannelID)'
'INNER JOIN TransformerTypes d'
'on a.OriginFacilityID = d.FacilityID)'
'INNER JOIN Customers cc'
'on a.DestinationFacilityID=cc.FacilityID'

'SET b.Quantity = ?'

  'WHERE d.TransformerTypeID = ?'
  'AND cc.FacilityID =?'
  '    AND b.ProductID = ?'
  '    AND b.PeriodID = ?':
  x3[j, k, p, t], j, k, p, t;


Best,

Aly


----- Original Message -----
From: "glpk xypron" <address@hidden>
To: address@hidden
Cc: address@hidden
Sent: Friday, August 27, 2010 12:37:13 PM GMT -05:00 US/Canada Eastern
Subject: Re: Another problem when connecting glpk to Access

Hello Aly,

it seems to me that your question is not on GLPK but on SQL
syntax (UPDATE with INNER JOIN). This list is only about GLPK.

Best regards

Xypron

-------- Original-Nachricht --------
> Datum: Fri, 27 Aug 2010 12:22:07 -0400 (EDT)
> Betreff: Another problem when connecting glpk to Access

> Hi Xypron,
> 
> Your previous continuous help was more than perfect in helping to read and
> write back to Access from glpk. I succeeded in writing variable values
> back to Access for most variables except one. The problem is described below:
> 
> The following code gets an error when writing the data:
> 
> Code:
> 
>  
> table x3_iii {j in TF, k in C, p in P, t in T: x3[j,k,p,t]>0} OUT 'ODBC'
>   'FileDSN=.\d2.dsn'
> 
>   'UPDATE ((Channels a INNER JOIN ChannelPeriodProducts b'
> 'ON a.ChannelID = b.ChannelID)'
> 'INNER JOIN TransformerTypes d'
> 'on a.OriginFacilityID = d.FacilityID'
> 'SET b.Quantity = ?'
>   'WHERE d.TransformerTypeID = ?'
>   'AND a.OriginFacilityID =?'
>   '    AND b.ProductID = ?'
>   '    AND b.PeriodID = ?':
>   x3[j, k, p, t], j, k, p, t;
> 
> Now, let me describe what I am basically trying to do: I'm trying to write
> the values for the variable x3[j,k,p,t] in its field "Quantity" in the
> table 'ChannelPeriodProducts'. The indices for that variable are j,k,p,t.
> 
> The 'ChannelPeriodProducts' table has a "ChannelID", "PeriodID",
> "ProductID" and "Quantity" fields. The index t is corresponding to 
> "PeriodID", the
> index p is corresponding to the field "ProductID", and the variable
> x3[j,k,p,t] itself, as I said, is corresponding to the field "Quantity".
> 
> The 'Channels' table has a "ChannelID", "OriginFacilityID" and
> "DestinationFacilityID" fields. The index k is corresponding to the field
> "DestinationFacilityID". The "ChannelID" field in it is corresponding to the
> "ChannelID" in the 'ChannelPeriodProducts' table.
> 
> Finally, the 'TransformerTypes' table has a "FacilityID" and a
> "TransformerTypeID" fields. The index k is corresponding to the field
> "TransformerTypeID". The "FacilityID" field in this 'TransformerTypes' table 
> is
> corresponding to the 'DestinationFacilityID' field in the Channels table.
> 
> Note that there are existing records in all tables, with the "Quantity"
> field in these records in the table 'ChannelPeriodProducts' empty (as it is
> to be filled by the output of the model).
> 
> Hope it is clear. I'd REALLY appreciate any help telling me how I can
> modify the above code in order to do what I want to do as explained above, or
> even provide me with a different code that does what I want to do!
> 
> Thanks a lot,
> 
> Aly 
> 
> 
> -- 
> PhD Student
> 
> Rm. 407 Main Building
> H. Milton Stewart School of Industrial and Systems Engineering
> Georgia Institute of Technology
> 765 Ferst Dr., NW
> Atlanta, Georgia 30332-0205, USA
> 

-- 
Neu: GMX De-Mail - Einfach wie E-Mail, sicher wie ein Brief!  
Jetzt De-Mail-Adresse reservieren: http://portal.gmx.net/de/go/demail

-- 
PhD Student

Rm. 407 Main Building
H. Milton Stewart School of Industrial and Systems Engineering
Georgia Institute of Technology
765 Ferst Dr., NW
Atlanta, Georgia 30332-0205, USA






reply via email to

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