Page 1 of 1

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

Posted: Fri 19 Aug 2005 15:38
by swierzbicki
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

Posted: Mon 22 Aug 2005 08:13
by Ikar
There are no easy ways but you can analyse query result SHOW CREATE TABLE

Posted: Mon 22 Aug 2005 09:00
by GEswin
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

Posted: Mon 22 Aug 2005 12:38
by swierzbicki
Doesn't MySQL provides C api for this ?

Posted: Tue 23 Aug 2005 14:53
by Ikar
> 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.

Posted: Tue 23 Aug 2005 14:54
by Ikar
> 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.

Posted: Tue 23 Aug 2005 16:22
by GEswin
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.

Posted: Wed 24 Aug 2005 09:30
by alec
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

Posted: Thu 25 Aug 2005 11:08
by Ikar
We will consider a possibility of adding this feature in MyDAC 3.10.

Posted: Thu 25 Aug 2005 16:15
by GEswin
3.10 or 4.10 ?

Posted: Fri 26 Aug 2005 06:27
by Ikar
Misprint
Must be 4.10

Posted: Thu 03 Aug 2006 14:48
by alan
Hello,


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

Posted: Fri 04 Aug 2006 11:13
by Ikar
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.