bug-glpk
[Top][All Lists]
Advanced

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

Re: [Bug-glpk] Assertion failed: str2num(buf, &num) == 0 Error detected


From: Noli Sicad
Subject: Re: [Bug-glpk] Assertion failed: str2num(buf, &num) == 0 Error detected in file ..\src\glpsql.c at line 900
Date: Sun, 14 Feb 2010 14:20:04 +0700

Hello Xypron,

Would it be possible to put 0 for this NULL rather terminating the
mathprog, just to process this query or reading table.

AMPL manage to process this query or reading table with NULL without error.

I am trying to convert AMPL to MathProg. Here is the original AMPL script.


printf "Reading Croptypes....\n";
table qryCroptype IN "ODBC" "Otago.mdb" : CROPTYPE <- [Croptype],
        CroptypeOrigin ~ Origin, CroptypeSpecies ~ Species,
        Value, Rental, Share, Flat, FlatRolling, RollingSteep, Steep, OpType;
read table qryCroptype;

I suppose you don't need the otago.mdb now.

Thanks. Noli

On 2/14/10, glpk xypron <address@hidden> wrote:
> Hello Noli,
>
> the error you described occurs if a numeric column contains
> a NULL.
>
> The following changes should be done to the coding:
>
> Line 900 and 1508 in glpsql.c
>             xassert(str2num(buf, &num) == 0);
> should be replaced by
>             if (str2num(buf, &num) != 0) {
>                xprintf("'%s' cannot be converted to a number.\n", buf);
>                return 1;
>             }
>
> The output for a NULL value will be something like:
>
> Connected to ACCESS 04.00.0000 - .\glpk
> SELECT * FROM query1
> '' cannot be converted to a number.
> test.mod:3: error on reading data from table ti
> MathProg model processing error
>
> Best regards
>
> Xypron
>
>
>
>
> -------- Original-Nachricht --------
>> Datum: Fri, 12 Feb 2010 14:14:11 +0700
>> Von: Noli Sicad <address@hidden>
>> An: address@hidden
>> Betreff: [Bug-glpk] Assertion failed: str2num(buf,   &num) == 0 Error
>> detected in file ..\\src\\glpsql.c at line 900
>
>> Andrew,
>>
>> I got this error.
>>
>> ~~~~~~~~~
>> Assertion failed: str2num(buf, &num) == 0
>> Error detected in file ..\src\glpsql.c at line 900
>> ~~~~~~~~
>>
>> Doing this,  Reading data from a query, not a table.
>>
>> ~~~~~~~~~
>> table qryCroptype IN "ODBC"
>>     'DSN=Otago_mdb'
>>     'SELECT * FROM qryCroptype':
>>      CROPTYPE <- [Croptype], CroptypeOrigin ~ Origin, CroptypeSpecies ~
>> Species,
>>      Value, Rental, Share, Flat, FlatRolling, RollingSteep, Steep, OpType;
>> ~~~~~~~~
>>
>> Thanks. Noli
>>
>>
>> _______________________________________________
>> Bug-glpk mailing list
>> address@hidden
>> http://lists.gnu.org/mailman/listinfo/bug-glpk
>
> --
> 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]