#1 2023-02-10 19:32:48

dcoun
Member
From: Crete, Greece
Registered: 2020-02-18
Posts: 392

Firedac does not get correct VType for the RawJson type

In a Torm that has a property of type RawJson I am getting an error when adding an object in the database:

ExceptionMessage="[FireDAC][Phys][MySQL]-335. Parameter [LA] data type is unknown. Hint: specify TFDParam.DataType or assign TFDParam value before Prepare/Execute call"

Investigating mormot.db.rad, line 586
      DatasetBindSqlParam(arrndx, p, fParams[p]);

I noticed that the VType for this RawJson Field in fParams is ftNull. changing during debugging to ftutf8 it saves the TOrm object in the database without error

Last edited by dcoun (2023-02-10 19:37:24)

Offline

#2 2023-02-10 20:15:49

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

Re: Firedac does not get correct VType for the RawJson type

I will look into it.

In the meantime, you can just use a RawUtf8 property.

For MySQL and FireDAC it won't make any difference.

Offline

#3 2023-02-13 11:47:10

dcoun
Member
From: Crete, Greece
Registered: 2020-02-18
Posts: 392

Re: Firedac does not get correct VType for the RawJson type

I can not reproduce it anymore. probably it had a connection with the uppercase table names that you fix the same day. Now RawJson works ok.
Thank you @ab

Offline

#4 2023-02-25 16:35:34

dcoun
Member
From: Crete, Greece
Registered: 2020-02-18
Posts: 392

Re: Firedac does not get correct VType for the RawJson type

The problem exists only if the RawJson field's contents is not a valid json. If it is '{}' or '[]', no error is produced

Offline

Board footer

Powered by FluxBB