Page 1 of 1

Retrieving enum types as string

Posted: 02.03.2009, 18:24
by PhillHS
Hi,

Using Delphi 7, Zeos 6.6.0.

I have a database table in MySQL 5.0.26 (linux) that has the following fields defined :

iselectrical enum('Y','N')
Interest enum('Y','N','U')

When I try and uses FieldByName('iselectrical').AsString it always returns 'true' or 'false', whereas if i use FieldByName('Interest'), it returns one of 'Y','N' or 'U'.

When I look at the type information for the 'iselectrical' field it is set to ftBoolean, whereas the type of 'Interest' is ftString.

Is there anyway of overiding this behavior, though I can understand why this is coded this way.

Cheers.

Phill.

Posted: 05.03.2009, 12:17
by mdaems
Edit the ConvertMySQLTypeToSQLType function in ZDbcMysqlUtils.pas.

Mark