#1 2019-07-05 11:39:30

bigheart
Member
Registered: 2014-08-01
Posts: 45

How to get the text field from sqlite

Hello,

When i try to select RawUtf8 field from sqlite DB, the return is incorrect as below:

FText: RawUtf8 and the its contents as json array format like

["{\"Name\":\"DI_0065_0\",\"Description\":\"Something one\"}","{\"Name\":\"DI_0065_1\",\"Description\":\"Something two\"}"]

But the select using CreateAndFillPrepare function, result is blank.

How can i get the select from json array format string?

Offline

#2 2019-07-05 12:22:31

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

Re: How to get the text field from sqlite

By definition, a RawUTF8 published property is stored as a JSON string, with espace of all JSON quotes.

I don't understand when you write "But the select using CreateAndFillPrepare function, result is blank". What does it mean?
I don't understand what you expect.

The best is to show some code to reproduce your problem, preferably not within the message post, but in https://gist.github.com/ or something similar.

Offline

#3 2019-07-08 11:47:36

Shadownildo
Member
From: Brazil
Registered: 2018-10-10
Posts: 36

Re: How to get the text field from sqlite

ab wrote:

By definition, a RawUTF8 published property is stored as a JSON string, with espace of all JSON quotes.

I don't understand when you write "But the select using CreateAndFillPrepare function, result is blank". What does it mean?
I don't understand what you expect.

The best is to show some code to reproduce your problem, preferably not within the message post, but in https://gist.github.com/ or something similar.


I Think what he want to say ab, is , he has the FText as a Field, and inside has a JSON Array, and he wants to Use the CreateAndFillPrepare , to Select Inside this array, Like

-> This JSON as value in a Field = ["{\"Name\":\"DI_0065_0\",\"Description\":\"Something one\"}","{\"Name\":\"DI_0065_1\",\"Description\":\"Something two\"}"]

FSomeTable.CreateAndFillPrepare(FServer,'Description LIKE ? ', ['%'+aValue]);

but i don't know if it's possible, because " Description " It's not a Real Field. FText Is

Offline

Board footer

Powered by FluxBB