PxPlus User Forum

Main Board => Discussions => Programming => Topic started by: Jeffrey Ferreira on August 18, 2020, 04:53:26 PM

Title: mysql read / key position
Post by: Jeffrey Ferreira on August 18, 2020, 04:53:26 PM
Hi list (i feel like i saw something about positioning a key on mysql read) but i can't find in search.

i have a mysql keyword table
so keyword is 4015551212
when i read the table
read (keyword,key="4015551212",dom=*next)
the read positions the key to the record right after 4015551212
i found a hack way around it but i would like to fix...
can someone help me
jeff
Title: Re: mysql read / key position
Post by: Peter.Higgins on August 18, 2020, 05:21:54 PM
Issue the read as SQL rather than fighting the emulation.
Title: Re: mysql read / key position
Post by: Devon Austen on August 19, 2020, 08:05:53 AM
Look at the type and length of the key field in MySQL and make sure the key= matches. It could be that the key field expects leading zeros or trailing spaces to be an exact match.

Also make sure PxPlus know what the MySQL key is either via a KEY= on the open or a IOL=*. If there are multiple keys make sure you are using the correct one i.e. KNO=.

You can also turn on the '!Q' system parameter and you will get message boxes for all the SQL that PxPlus sends to the MySQL server. This may help you figure out why it isn't finding the exact record you are expecting.