Thread: [Squirrel-sql-users] MySQL ENUM DataType
A Java SQL client for any JDBC compliant database
Brought to you by:
colbell,
gerdwagner
From: Wedra <pe...@in...> - 2009-04-10 06:24:36
|
The MySQL ENUM DataType is not supported? I have a table with some fields "enum('t','f')"... |
From: Wedra <pe...@in...> - 2009-04-09 09:51:54
|
The MySQL ENUM DataType is not supported? I have a table with some fields "enum('t','f')"... |
From: Matthew D. <mda...@ja...> - 2009-04-10 14:44:33
|
Did you run into some sort of problem? What did you encounter? Regards, Matt -----Original Message----- From: Wedra [mailto:pe...@in...] Sent: Thursday, 09 April, 2009 23:29 To: squ...@li... Subject: [Squirrel-sql-users] MySQL ENUM DataType The MySQL ENUM DataType is not supported? I have a table with some fields "enum('t','f')"... -------------------------------------------------------------------------- ---- This SF.net email is sponsored by: High Quality Requirements in a Collaborative Environment. Download a free trial of Rational Requirements Composer Now! http://p.sf.net/sfu/www-ibm-com _______________________________________________ Squirrel-sql-users mailing list Squ...@li... https://lists.sourceforge.net/lists/listinfo/squirrel-sql-users |
From: Wedra <pe...@in...> - 2009-04-14 07:29:28
|
I put 2 case (1) Right click on table name -> Refactoring -> Column -> Add (Modify) column -> Dialect: MySQL In Type field ENUM is not present (2) Right click on table name -> Scripts -> Create table script The output is: CREATE TABLE `dbname`.`tablename` ( id int, description longtext, flag char(2) ) ; But the right struct is: CREATE TABLE `dbname`.`tablename` ( id int, description longtext, flag enum('t','f') ); I can live without ENUM (in squirrel), but some old software require it, and would be convenient for me use it in squirrel wedra Matthew Dahlman ha scritto: > Did you run into some sort of problem? What did you encounter? > > Regards, > Matt > > -----Original Message----- > From: Wedra [mailto:pe...@in...] > Sent: Thursday, 09 April, 2009 23:29 > To: squ...@li... > Subject: [Squirrel-sql-users] MySQL ENUM DataType > > The MySQL ENUM DataType is not supported? > > I have a table with some fields "enum('t','f')"... > > > -------------------------------------------------------------------------- > ---- > This SF.net email is sponsored by: > High Quality Requirements in a Collaborative Environment. > Download a free trial of Rational Requirements Composer Now! > http://p.sf.net/sfu/www-ibm-com > _______________________________________________ > Squirrel-sql-users mailing list > Squ...@li... > https://lists.sourceforge.net/lists/listinfo/squirrel-sql-users > > |
From: Robert M. <rob...@gm...> - 2009-04-14 11:49:13
|
Wedra, The trouble with the ENUM data type is that it is not supported as a recognizable SQL data type in Java. (Possibly the designers of JDBC excluded it from the supported types because it is non-standard). To make matters worse, the MySQL JDBC driver writers mapped it to the CHAR type. Of course this is understandable given that the valid values for an ENUM type are only string literals. However, it means that the only way to identify an ENUM type in the metadata is to use the "type name", not the "type code". If that were the only problem, I would have a prompt work-around. However, since ENUM is not supported in Java, that means there is no JDBC API for accessing the valid string literals that a particular ENUM column must have. So, in this case, we would need to query the database data dictionary to find this info. Now, all of this is possible, but would take some thought on how to make the mechanism general enough so that it can be re-used when working with other non-portable data types in other databases, where this same problem is likely to occur. Could you add a feature request for this and mention the two use cases that you gave in your previous email ? Thank you. Rob On Tue, Apr 14, 2009 at 3:29 AM, Wedra <pe...@in...> wrote: > I put 2 case > > (1) Right click on table name -> Refactoring -> Column -> Add (Modify) > column -> Dialect: MySQL > > In Type field ENUM is not present > > > (2) Right click on table name -> Scripts -> Create table script > > The output is: > > CREATE TABLE `dbname`.`tablename` > ( > id int, > description longtext, > flag char(2) > ) > ; > > But the right struct is: > > CREATE TABLE `dbname`.`tablename` ( > id int, > description longtext, > flag enum('t','f') > ); > > > I can live without ENUM (in squirrel), but some old software require it, > and would be convenient for me use it in squirrel > > > wedra > > > > Matthew Dahlman ha scritto: >> Did you run into some sort of problem? What did you encounter? >> >> Regards, >> Matt >> >> -----Original Message----- >> From: Wedra [mailto:pe...@in...] >> Sent: Thursday, 09 April, 2009 23:29 >> To: squ...@li... >> Subject: [Squirrel-sql-users] MySQL ENUM DataType >> >> The MySQL ENUM DataType is not supported? >> >> I have a table with some fields "enum('t','f')"... >> >> >> -------------------------------------------------------------------------- >> ---- >> This SF.net email is sponsored by: >> High Quality Requirements in a Collaborative Environment. >> Download a free trial of Rational Requirements Composer Now! >> http://p.sf.net/sfu/www-ibm-com >> _______________________________________________ >> Squirrel-sql-users mailing list >> Squ...@li... >> https://lists.sourceforge.net/lists/listinfo/squirrel-sql-users >> >> > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by: > High Quality Requirements in a Collaborative Environment. > Download a free trial of Rational Requirements Composer Now! > http://p.sf.net/sfu/www-ibm-com > _______________________________________________ > Squirrel-sql-users mailing list > Squ...@li... > https://lists.sourceforge.net/lists/listinfo/squirrel-sql-users > |