JDBC Primary Index
Teradata Teradata Discussion Forums Teradata.com Discussion Forum
Visit Teradata.com
Home       Guidelines    Member List
Welcome Guest ( Login | Register )
        


This online forum is for user-to-user discussions of Teradata products, and is not an official customer support channel for Teradata. If you require direct assistance, please contact Teradata support.


JDBC Primary Index Expand / Collapse
Author
Message
Posted 2/19/2008 10:44:13 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 8/18/2008 4:08:20 PM
Posts: 9, Visits: 38
I'm attempting to write a Java application which creates test data in a table specified by the user. But my app needs to know which columns need to be unique, and which make up the index and/or primary index of the table. Since the Teradata JDBC driver does not support getIndexInfo, is there another way I can obtain this information?
Post #10629
Posted 2/19/2008 10:06:26 PM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: 8/24/2008 2:47:14 PM
Posts: 425, Visits: 398
Are you sure getIndexInfo() didn't work for you ?

I recall my development team using something like that in the past to retrieve this information.

Another way is to select from dbc.indices (make use of the uniqueflag column)
Post #10633
Posted 2/20/2008 9:26:16 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 8/18/2008 4:08:20 PM
Posts: 9, Visits: 38
Well the samples that came with the driver included a file showing how to get index information, leading me to believe that it worked. But when I tried using getIndexInfo(), INDEX_NAME in the ResultSet was always null. I know the ResultSet was set correctly because TABLE_NAME and some other data was present, but the actual name of the index column(s) were not there.

Maybe I'm having nomenclature issues...the Index that getIndexInfo() is talking about should be Teradata's Index, right...like the primary index? Or is it some other relational db feature with the same name?
Post #10648
Posted 2/20/2008 9:31:23 AM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: 8/24/2008 2:47:14 PM
Posts: 425, Visits: 398
INDEX_NAME would be NULL if the index wasn't given a name during the time of creation (which is purely optional in TD) ... (you can check the table DDL via the show table tablename) command to see if those indexes had a name or not.
Post #10649
Posted 2/20/2008 9:32:13 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 8/18/2008 4:08:20 PM
Posts: 9, Visits: 38
Ok, thanks.

And I just looked into using dbc.indices, and that will work great for what I need. Thanks a lot!
Post #10650
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 0 ( 0 guests, 0 members, 0 anonymous members )
No members currently viewing this topic.


All times are GMT -5:00, Time now is 2:43pm

Powered By InstantForum.NET v4.1.4 © 2008
Execution: 0.063. 7 queries. Compression Disabled.