#1 2018-01-08 18:36:58

Sapiem
Member
Registered: 2017-12-08
Posts: 62

SELECT return error data

I am trying to recode my app, migrating the SQLite usage code from ZeosLib to mORMot. All right, until I realize that sometimes, when there are empty fields, the SQL SELECT returns the value of that empty field, with the value of the following fields, example:

Suppose:
Field1 = 'Value 1'
Field2 = ''
Field3 = 34
Field4 = 'Blue'

SELECT Field1, Field2, Field3, Field4 FROM Table 1

Field1 = 'Value 1'
Field2 = '34Blue'
Field3 = 34
Field4 = 'Blue'

Sometimes, when the number of records returned by the SELECT is greater than one, the empty fields remain correctly empty.

Offline

#2 2018-01-09 08:24:50

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,272
Website

Re: SELECT return error data

Weird. Never seen it in practice.
Could you post on PasteBin some code to reproduce it?

Offline

#3 2018-01-09 11:37:50

Sapiem
Member
Registered: 2017-12-08
Posts: 62

Re: SELECT return error data

The code is the same of example # 17, the only change is the database that I open. I still working with example # 17 until I hace all that I need and then migrate all my original code to mORMot. I'll try to extract some piece of databse and try to reproduce this error. I use Delphi Berlin.

Offline

#4 2018-01-09 12:28:49

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,272
Website

Re: SELECT return error data

With which cbbDataSource item?

Offline

#5 2018-01-09 17:22:52

Sapiem
Member
Registered: 2017-12-08
Posts: 62

Re: SELECT return error data

I don't understand you. I use the same code of example # 17. It use this datasource (ds1: TDataSource;)

Offline

#6 2018-01-09 20:09:49

Junior/RO
Member
Registered: 2011-05-13
Posts: 207

Re: SELECT return error data

Please give us some screen shot of this

Offline

#7 2018-01-10 03:16:06

Sapiem
Member
Registered: 2017-12-08
Posts: 62

Re: SELECT return error data

Screenshot?

Offline

#8 2018-01-11 03:26:26

Sapiem
Member
Registered: 2017-12-08
Posts: 62

Re: SELECT return error data

How can I send you a screenshot from my PC?

Offline

#9 2018-01-15 21:06:24

Sapiem
Member
Registered: 2017-12-08
Posts: 62

Re: SELECT return error data

Hello?

Offline

#10 2018-01-16 08:44:58

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,272
Website

Re: SELECT return error data

Use a picture upload web site, e.g. https://imgur.com/ or any other, then put a "img" link in the forum.

Offline

#11 2018-01-16 12:56:04

Sapiem
Member
Registered: 2017-12-08
Posts: 62

Re: SELECT return error data

Look at the Caption bar. This is the result of showing the content of the field that is really empty, but it shows me the union of the previous field next to the next one. Look at the Grid: I am showing the field "Equipo" and it shows me the union of the "CI" field next to the following "DatosClin".

LwQH4YO.png

Last edited by Sapiem (2018-01-16 13:04:26)

Offline

#12 2018-01-16 13:38:59

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,272
Website

Re: SELECT return error data

Difficult to tell with just a screenshot.

Try to use the debugger to find out where the problem may be in the mORMotVCL.pas unit.

Offline

#13 2018-01-16 13:45:31

Sapiem
Member
Registered: 2017-12-08
Posts: 62

Re: SELECT return error data

Ok, I'll check at home. Sorry, but I'm doctor and I have a lot of professional work. Thanks for all.

Offline

#14 2018-01-17 04:34:53

Sapiem
Member
Registered: 2017-12-08
Posts: 62

Re: SELECT return error data

I try but the mORMotVCL.pas unit never si used by code.

Offline

#15 2018-01-25 12:35:36

Sapiem
Member
Registered: 2017-12-08
Posts: 62

Re: SELECT return error data

Using Table (sample 12 - SynDB Explorer) plus ToDataSet function solve the problem.

Offline

Board footer

Powered by FluxBB