Using ODBC to determine column uniqueness.



Hey folks, at the moment I really don't think this is possible but
decided to throw it on here to see if there were any ideas.

Essentially, I would like a way to grab any 1) arbitrary table (that I
have permissions to) in DBMS that I have an ODBC connection too; 2) A
column in that table and determine 3) If there are repeated values in
that column.

What I *don't* want to do is check for column uniqueness by doing a
query for the column and check manually if there are repeated values
by either
1) looping through to check for duplicates ( O(n^2) time )
2) Sorting the column and comparing adjacent values ( like O (n^2 log
n) I think)

What I would like an consistent ODBC-ish way to extract the meta data
for the column to determine if it was declared as Unique in the DDL (I
know there could also be unique columns not declared in the DDL but I
don't care about those) which would tell me in constant O(1) time if
it's unique regardless of the DBMS I'm using. Actually, I would really
like more meta data (e.g. check constraints that may have been DDL'd
into the column) but I'd be happy for this.

I know about the INFORMATION_SCHEMA views in the ANSI Standard, but
there are significant DBMS's that do not support (e.g. Oracle) so it's
no good.

Again, I figure this is a dream, but who knows! Thanks!
.



Relevant Pages

  • Re: Using ODBC to determine column uniqueness.
    ... JD> the DDL (I know there could also be unique columns not declared in ... JD> constant Otime if it's unique regardless of the DBMS I'm using. ... I would really like more meta data (e.g. check ... Common Lisp ODBC interface - lisp.ystok.ru/ysql/ ...
    (microsoft.public.data.odbc)
  • Re: Using ODBC to determine column uniqueness.
    ... JD> the DDL (I know there could also be unique columns not declared in ... JD> constant Otime if it's unique regardless of the DBMS I'm using. ... I would really like more meta data (e.g. check ... Common Lisp ODBC interface - lisp.ystok.ru/ysql/ ...
    (microsoft.public.data.odbc)