How to retreive the list of an mySQL Enum / Set field

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
swierzbicki
Posts: 451
Joined: Wed 19 Jan 2005 09:59

How to retreive the list of an mySQL Enum / Set field

Post by swierzbicki » Fri 19 Aug 2005 15:38

Hi,

How can I achieve this.
Is there any mydac method making this posible (retreive a list) so that i can automatically fill my DBCombobox with ?

Thank

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Mon 22 Aug 2005 08:13

There are no easy ways but you can analyse query result SHOW CREATE TABLE

GEswin
Posts: 186
Joined: Wed 03 Nov 2004 16:57
Location: Spain
Contact:

Post by GEswin » Mon 22 Aug 2005 09:00

Hi Ikar, competitors product has this feature, and when you attach a grid to their query it show already the ENUM values. This would be a very nice feature for myDac.

Regards

swierzbicki
Posts: 451
Joined: Wed 19 Jan 2005 09:59

Post by swierzbicki » Mon 22 Aug 2005 12:38

Doesn't MySQL provides C api for this ?

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Tue 23 Aug 2005 14:53

> Hi Ikar, competitors product has this feature, and when you attach a grid to
> their query it show already the ENUM values.

Please specify what product you mean.

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Tue 23 Aug 2005 14:54

> Doesn't MySQL provides C api for this ?

Not, MySQL API and MySQL Protocol don't provide this information. To obtain it you need to execute an additional query and then analyze it.

Also VCL doesn't provide a way to pass this information from TDataSet descendants to TControl descendants.

GEswin
Posts: 186
Joined: Wed 03 Nov 2004 16:57
Location: Spain
Contact:

Post by GEswin » Tue 23 Aug 2005 16:22

Hi Ikar, it's Micro0lap's that provide this functionality. Last year when i evaluated both products i noticed that theirs provide this functionality, but CRLab's Mydac is better support & speed.

Right now I solved this problem using DevEx cxDBImageLookup's and setting internally the different values. But it has one disadvantge, when you change DB you have to add/remove values from program.

alec
Posts: 20
Joined: Wed 24 Aug 2005 09:28
Location: Africa

Post by alec » Wed 24 Aug 2005 09:30

If you want to determine all possible values for an ENUM column, use SHOW COLUMNS FROM tbl_name LIKE enum_col and parse the ENUM definition in the second column of the output.
(c) MySQL AB

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Thu 25 Aug 2005 11:08

We will consider a possibility of adding this feature in MyDAC 3.10.

GEswin
Posts: 186
Joined: Wed 03 Nov 2004 16:57
Location: Spain
Contact:

Post by GEswin » Thu 25 Aug 2005 16:15

3.10 or 4.10 ?

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Fri 26 Aug 2005 06:27

Misprint
Must be 4.10

alan

Post by alan » Thu 03 Aug 2006 14:48

Hello,


I am curious as to if this feature was implemented? And if so how would you use it?

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Fri 04 Aug 2006 11:13

We have investigated the problem deeply.
Unfortunately ENUM and SET fields are very poorly supported in MySQL protocol. Moreover, TField and data-aware visual components do not provide functionality necessary to handle these fields. So implementing enhanced support for ENUMs and SETs is rather problematic. We recommend to use dictionary tables in cases where ENUM or SET fields might look suitable.

Post Reply