Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
No. of attributes is larger than no. of attribute values
Message
From
03/08/2022 06:53:32
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01684739
Message ID:
01684772
Views:
21
Martina,

This is the CursorSchema of table PIHDR:
CREATE TABLE `pihdr` (
  `refno` char(8) DEFAULT '',
  `date` date NOT NULL,
  `supplierid` char(5) DEFAULT '',
  `suprefno` char(15) DEFAULT '',
  `terms` tinyint DEFAULT '0',
  `isvat` tinyint DEFAULT '0',
  `vatrate` decimal(6,2) DEFAULT '0.00',
  `isewtax` tinyint DEFAULT '0',
  `ewtaxid` char(5) DEFAULT '',
  `ewtaxrate` decimal(6,2) DEFAULT '0.00',
  `dtlcnt` decimal(3,0) DEFAULT '0',
  `totqty` decimal(12,2) DEFAULT '0.00',
  `amtgross` decimal(15,2) DEFAULT '0.00',
  `amtvat` decimal(12,2) DEFAULT '0.00',
  `amtpurch` decimal(15,2) DEFAULT '0.00',
  `amtewtax` decimal(12,2) DEFAULT '0.00',
  `amtpayable` decimal(15,2) DEFAULT '0.00',
  `jrnlcnt` decimal(3,0) DEFAULT '0',
  `amtdebit` decimal(15,2) DEFAULT '0.00',
  `amtcredit` decimal(15,2) DEFAULT '0.00',
  `istemplate` tinyint DEFAULT '0',
  `jthdrid` char(32) DEFAULT '',
  `notes` text,
  `posted` tinyint DEFAULT '0',
  `cancelled` tinyint DEFAULT '0',
  `printctr` tinyint DEFAULT '0',
  `uidcreate` char(20) DEFAULT '',
  `uidedit` char(20) DEFAULT '',
  `uidprint` char(20) DEFAULT '',
  `uidpost` char(20) DEFAULT '',
  `id` char(32) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`),
  UNIQUE KEY `REFNO` (`refno`),
  KEY `SUPPLIERID` (`supplierid`),
  KEY `EWTAXID` (`ewtaxid`),
  KEY `JTHDRID` (`jthdrid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
My gut is telling me there is something wrong too many TINYINT and DECIMAL columns?

I got another module with same error, and both have that in common.

Dennis

>Hi Dennis,
>
>It's possible upload script with tables and examples data for experiments?
>
>MartinaJ
>
>>Hi Martina,
>>
>>I use MySQL Server 8.0.30, not 8.0.29. The MySQL ODBC I installed is 8.0.30.
>>
>>driver=MySQL ODBC 8.0 Unicode Driver
>>server=localhost
>>port=1686
>>uid=root
>>pwd=p@55w0rd
>>database=metalbank
>>option=536870912
>>sslmode=DISABLED
>>
>>
>>Dennis
>>
>>
>>>Hi Dennis,
>>>
>>>You test MySQL 8.0.29, but latest version is 8.0.30.
>>>I did try MySQL 8.0.30 and ODBC connector 8.0.30 and number 4000000000 was coverts to string automaticaly (I don't set flag in connection string).
>>>
>>>MartinaJ
>>>
>>>>Hi Martina,
>>>>
>>>>Already did the changes. It is part of my base class so it is easy on my part.
>>>>
>>>>Also, I think we should really change it since using option=13684 (BIGINT) from MySQL will only convert it to VFP integer data, which we know has a limit.
>>>>
>>>>At least, using option=536870912 gives us the real values; we only need to convert using VAL().
>>>>
>>>>However, my problem still remains:
>>>>
>>>>ERROR [01000] [MySQL][ODBC 8.0(w) Driver][mysqld-8.0.29]The number of attributes is larger than the number of attribute values provided
>>>>
>>>>
>>>>I shall go back to using MySQL ODBC 8.0.30 and Server 5.7.39 for now.
>>>>
>>>>Regards
>>>>Dennis
>>>>
>>>>
>>>>>Hi Dennis,
>>>>>
>>>>>Not is good way, becase you must rewrite your application, if you got datatype char instead number.
>>>>>
>>>>>IMHO, safety is using older ODBC driver.
>>>>>
>>>>>MartinaJ
>>>>>
>>>>>>Hi Martina,
>>>>>>
>>>>>>I changed option=13684 (Treat BIGINT columns as INT columns) to option=536870912 (Bind BIGINT parameters as strings).
>>>>>>
>>>>>>select 4000000000 yielded "4000000000 " -> a 20 character string.
>>>>>>
>>>>>>So I guess option=536870912 is way better?
>>>>>>
>>>>>>Dennis
>>>>>>
>>>>>>
>>>>>>>Hi Denis,
>>>>>>>
>>>>>>>ODBC driver converts number 4000000000 to -294967296?
>>>>>>>
>>>>>>>Hmm,
>>>>>>>
>>>>>>>
>>>>>>>?CAST(4000000000 as int) && return -294967296
>>>>>>>
>>>>>>>
>>>>>>>IMHO, the ODBC driver got 4000000000 as bigint, but VFP don't know bigint datatype and convert to signed int.
>>>>>>>Question is why ODBC driver ignore NO_BIGINT flag?
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>select CAST(4000000000 AS DECIMAL(20))
>>>>>>>-- select CAST(4000000000 AS INTEGER) -- converts to bigint - by documentation
>>>>>>>
>>>>>>>
>>>>>>>MartinaJ
>>>>>>>
>>>>>>>>Hi Martina,
>>>>>>>>
>>>>>>>>I tried the different select's you told me to do:
>>>>>>>>
>>>>>>>>
>>>>>>>>select 1
>>>>>>>>select 10
>>>>>>>>select 10000
>>>>>>>>select 4000000000
>>>>>>>>
>>>>>>>>
>>>>>>>>The first 3 yielded the same numbers, except for 4000000000, which yielded -294967296 !!!
>>>>>>>>
>>>>>>>>Why is this so? Pardon my ignorance.
>>>>>>>>
>>>>>>>>Regards
>>>>>>>>Dennis
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform