Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

list of all available data types

0 views
Skip to first unread message

mysql_...@wonderland.com

unread,
Dec 17, 2008, 7:40:25 AM12/17/08
to

I would like to know if there is a way to programmatically list all
available data types
in mysql. I don't mean all data types associated with a table that can be
derived from
the INFORMATION_SCHEMA. But all data types possible. The reason I need this
is that part of a GUI I'm writing requires the user to select a mysql data
type from
a drop down list. I know I can just hard code the types, but I would prefer
to derive
the list in the code in case mysql makes changes to their data types in the
future.
Thanks for any help - DR

strawberry

unread,
Dec 17, 2008, 8:34:43 AM12/17/08
to

I can come up with a crude way of getting all current datatypes, but
it's not really futureproof. I'm not even certain that is works on all
installations, but it works on mine:

use mysql;

SELECT name
FROM help_topic
WHERE (help_category_id = 1 AND name NOT LIKE '% %')
AND (help_category_id = 1 AND name NOT LIKE '%\_%')
ORDER
BY name;

Captain Paralytic

unread,
Dec 17, 2008, 9:50:03 AM12/17/08
to

How will you know whether the new datatype should be quoted/
escaped/.....?

mysql_...@wonderland.com

unread,
Dec 18, 2008, 3:33:29 AM12/18/08
to
Thanks for the replies, I appreciate both of your insights
0 new messages