Topic: Bug in Select-Statement

Hi,

I've made a very simple database (just for learning MVD) where most fields are TEXT. Just 5 fields are INTEGER.
For printing I've started to make a report. All works fine as long as I dont fill in values into the INTEGER fields.
If I try to print then I get a strange error message which seems not to be related to any values in the form.
But if I look at the select statement then it gets clear.
As soon as there is any value in one of the INTEGER fields, then all following compare values of the TEXT fields have no quotation marks any more. And with that the select will fail of course.

Can you check this please?

Kind Regards
Wood

Post's attachments

Attachment icon Bug_2019-11-26 16_44_23-WrongSelect.png 80.72 kb, 163 downloads since 2019-11-26 

Re: Bug in Select-Statement

Hi,
If you upload your project, I'm sure someone will be able to have a look.
Derek.

Re: Bug in Select-Statement

No problem, see attached ZIP file.

But the statement is not written by me, it is generated by MVD if you press the print button.
Double click the record of "Tom Garden" and press print button (named "Drucken") and you will see.
If you remove the value of the field RAM then you can print without problems!

Kind Regards
Wood

Re: Bug in Select-Statement

I hope this time the file is attached :-)

Post's attachments

Attachment icon Verwaltung-MVD.zip 1.1 mb, 278 downloads since 2019-11-26 

5 (edited by derek 2019-11-26 18:50:11)

Re: Bug in Select-Statement

Hi Wood,
I understand why you might think that the integer fields are the problem, but I've been able to print a record that has, for example, a value in the RAM field, so I think it might be another issue.
When you change some of your data and try to print, the error message changes and highlights different fields / values so I'm wondering if it might even be the size of the actual select statement (you have 36 components plus their values!) that is causing errors in the query plan - but it's just a guess;  maybe someone else could either confirm or correct me on that.
But you don't actually need to specify any components in your search anyway because you have already selected a single record from the tablegrid on the previous form.  So as a simple fix, I'd suggest you remove them all (see attached screenshot) and run the report like that.
Derek.

Post's attachments

Attachment icon wood screenshot.jpg 151.01 kb, 123 downloads since 2019-11-26 

6 (edited by Wood 2019-11-26 20:22:26)

Re: Bug in Select-Statement

Hi Derek,

Thank you so far! Your answer inspired me to test another thing.
This is what I found: I can print without error when I remove the 5 INTEGER fields and then include them again!
With that the 5 fields are placed at the end of the sql statement. In this constellation there is no chance for MVD to produce the error, because no TEXT fields are following then.
Now I'm still more convinced that there is a bug in generating the correct sql statement when INTEGER fields are included and TEXT fields are following when search fields are in use.

In my case, you are right, I dont need the search fields (it took a while until I realized what you meant).
But for other users, using the search fields, the error exists.

Thank you for your quick help!

Kind Regards
Wood

Re: Bug in Select-Statement

Anyway you found a bug, I will fix it.

Dmitry.