All,

I'd like to be able to query MySql using the JDBC driver to determine which
tables have auto incremented columns.

In MSSQL I can retrieve data from the syscolumns and sysobjects tables to
find out which columns are IDENTITY columns, but have had no luck trying to
do something similar in MySql (4.05).

e.g.

select so.name, sc.name from syscolumns sc, sysobjects so where sc.autoval
is not null and so.xtype = 'U' and so.id = sc.id order by 1,2


I'm extending some J2EE app generator functionality, and so would like to be
able to scan a database without knowing beforehand (based on business
knowledge) which tables have auto incremented columns.

I've tried:

1. Going over the java.sql metadata functionality to see if I can query this
through the standard java.sql functions.

2. Searching the MySql manual

Any help much appreciated.

Greg.


sql, query


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to