> I'm trying to connect Excel 2007 to GLPKthrough ODBC, but I have a
> problem.

> I define my file in the driver Microsoft Excel Driver (*.xls,
> *.xlsx, *.xlsm, *.xlsb), but then when I put that in my GLPK code, I
> get the message "string literal too long".

> Here's the part of my code for that:

> table pq_ivt {i in I, v in V, t in T} OUT 'ODBC'
>   'DRIVER={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm,
> *.xlsb)};READONLY=FALSE;dbq=GEE_Outputs_April_2010.xlsx'
>   'INSERT INTO [Purchased Quantities - pq$]'
>   '(Suppliers, Components, Periods, Purchased_Quantities)'
>   'VALUES(?, ?, ?, ?);' :
>   i ~ Suppliers, v ~ Components, t ~ Periods, pq[i,v,t] ~ 
> Purchased_Quantities;

> I also tried 'DRIVER={Microsoft Excel Driver
> (*.xlsx};READONLY=FALSE;dbq=GEE_Outputs_April_2010.xlsx', but still
> didn't work.

> Any help will be greatly appreciated.

You can split a long sql statement into shorter ones, for example,
as follows (all string literals will be concatenated):

table pq_ivt {i in I, v in V, t in T} OUT 'ODBC'
  'DRIVER='
  '{Microsoft Excel Driver '
  '(*.xls, *.xlsx, *.xlsm,*.xlsb)};'
  'READONLY=FALSE;'
  'dbq=GEE_Outputs_April_2010.xlsx'
  'INSERT INTO [Purchased Quantities - pq$]'
  '(Suppliers, Components, Periods, Purchased_Quantities)'
  'VALUES(?, ?, ?, ?);' :
  i ~ Suppliers, v ~ Components, t ~ Periods,
  pq[i,v,t] ~ Purchased_Quantities;





_______________________________________________
Help-glpk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-glpk

Reply via email to