SET fields

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
cyrilo
Posts: 18
Joined: Wed 11 Oct 2006 08:47

SET fields

Post by cyrilo » Mon 08 Sep 2014 09:05

I know about Delphi restrictions with SET fields :(
How can I better replace SET fields in DB? To transform one SET field into few BOOLEAN fields?

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: SET fields

Post by ViktorV » Mon 08 Sep 2014 13:47

Please describe the problem in more details.

cyrilo
Posts: 18
Joined: Wed 11 Oct 2006 08:47

Re: SET fields

Post by cyrilo » Tue 09 Sep 2014 09:35

I have SET field:

Code: Select all

CREATE TABLE set_test(myset SET('red','blue','green'));
Using SET is not recommended with Delphi by DevArt Team
The problem solution is replacing one SET field to few BOOLEAN fields

Code: Select all

CREATE TABLE set_test(red BOOLEAN, blue BOOLEAN, green BOOLEAN);
Is it best way to workaround?

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: SET fields

Post by ViktorV » Thu 11 Sep 2014 09:09

We don't say that we don't recommend to use SET fields anywhere.
We say that Delphi does not support the SET field type, and this type is mapped to TStringField, and you can work with SET fields as with strings.
There are various solutions - all depends on your project, architecture, aims and requirements.

Post Reply