[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-glpk] field missing in input table + instruction table
From: |
Heinrich Schuchardt |
Subject: |
Re: [Help-glpk] field missing in input table + instruction table |
Date: |
Fri, 5 Dec 2014 17:18:31 +0100 |
Hello Haroune,
the problem in you Excel is that the used range of the Excel-Sheet contains
empty cells.
Simply delete all empty lines or specify the range to be considered with:
table CROP_PARTS IN 'ODBC'
'DRIVER={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};
dbq=.\exemple-format-excel.xlsx'
'SELECT * FROM [CROP_PARTS$A1:E5]':
CPID <- [CPID], CPCrop, CPName, CPType;
If you want to specify a string of length zero enter ' into the cell.
Best regards
Heinrich Schuchardt
http://www.xypron.de
> Gesendet: Freitag, 05. Dezember 2014 um 16:59 Uhr
> Von: "Haroune ZAGHDAOUI" <address@hidden>
> An: "Heinrich Schuchardt" <address@hidden>
> Cc: "Help Glpk" <address@hidden>
> Betreff: Re: [Help-glpk] field missing in input table + instruction table
>
> Hello Heinrich,
>
> Ok for having just one SELECT per table statement.
>
> About the other question, I know about sudoku example. And I know how to
> write the instruction. But the problem persists. My first line already
> contain, of course, the column names. But there is a kind of bug, it's like
> it's coming from the connection between Gusek and Excel. I joined and example
> in Gusek with it's file Excel. Could you please test it? You will see that
> the problem is weird. And as I said in my previous mail, it's easy to fix the
> problem : move the Excel table table one row down (you will have the 1st row
> empty...), then you delete the 1st row, then start again the program Gusek :
> it works! What's the matter?
>
> Best regards,
> Haroune ZAGHDAOUI.
>
> ----- Mail original -----
> De: "Heinrich Schuchardt" <address@hidden>
> À: "Haroune ZAGHDAOUI" <address@hidden>, "Help Glpk" <address@hidden>
> Envoyé: Vendredi 5 Décembre 2014 13:22:28
> Objet: Re: [Help-glpk] field missing in input table + instruction table
>
> Hello Haroune,
>
> you can only have one SELECT per table statement.
>
> The first line of your selected Excel sheet or range should contain the
> column names. See examples/sql/sudoku.xls and sudoku_excel.mod in GLPK for
> Windows.
>
> Best regards
>
> Heinrich Schuchardt
>
> http://www.xypron.de
>
> Am 05.12.14 um 12:29 schrieb Haroune ZAGHDAOUI
>
> > Hello everyone!
> >
> >
> >
> > I need your help please, I have 2 questions :
> >
> >
> >
> > 1) I got a problem with the instruction table. Sometimes, I don't no why,
> > when I try to load my Excel tables (via ODBC driver), one of the tables
> > don't want to be loaded. It says :
> >
> >
> >
> >
> >
> >
> >
> > Reading CROP_PARTS...
> >
> > Connected to EXCEL 12.00.0000 - .\exemple-format-excel.xlsx
> >
> > SELECT * FROM [CROP_PARTS$]
> >
> > new-model.mod:73: field CPID missing in input table
> >
> >
> >
> > The point is that in the same Gusek program, I load different tables. All
> > of them works except when the program arrive to this table.
> >
> > I resolved the problem but it's not a logical manner : I move my table (in
> > Excel) one row down and I deleted the 1st line and it works! There was
> > nothing in this line. So I was asking myself if the problem comes when we
> > change the values in the Excel table and Gusek have a problem to read them
> > (but it's a weird proposition...)...
> >
> >
> >
> > 2) Is it possible to load different Excel sheet with the same instruction?
> > I mean, in order to write this :
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > table TEST1 IN 'ODBC'
> >
> > 'DRIVER={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};
> > dbq=.\exemple-excel.xlsx'
> >
> > 'SELECT * FROM [Sheet1$]':
> >
> > CPID <- [CPID], CPCrop, CPName, CPType;
> >
> >
> >
> >
> >
> > table TEST2 IN 'ODBC'
> >
> > 'DRIVER={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};
> > dbq=.\exemple-excel.xlsx'
> >
> > 'SELECT * FROM [Sheet2$]':
> >
> > LID <- [LID], LName, LType, LAddr, LCity, LZIP, LHours;
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > ...I would prefer to write something like that :
> >
> >
> >
> > table TEST IN 'ODBC'
> >
> > 'DRIVER={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};
> > dbq=.\exemple-excel.xlsx'
> >
> > 'SELECT * FROM [Sheet1$]': CPID <- [CPID], CPCrop, CPName, CPType;
> >
> > 'SELECT * FROM [Sheet2$]': LID <- [LID], LName, LType, LAddr, LCity, LZIP,
> > LHours;
> >
> >
> >
> > What I need is just to take the data to use them in Gusek for some problems
> > (Facility Location, VRP,...). I can have about 15 sheets...
> >
> >
> >
> > Thank you so much for your help.
> >
> >
> >
> > Yours Sincerly,
> >
> > Haroune ZAGHDAOUI
> >
> > University of Technology of Troyes
> >
> > Engineering of Industrial Systems
> >
> > _______________________________________________
> >
> > Help-glpk mailing list
> >
> > address@hidden
> >
> > https://lists.gnu.org/mailman/listinfo/help-glpk
>