Difference between revisions of "Documentation/DevGuide/Database/Adding an Index"

From Apache OpenOffice Wiki
Jump to: navigation, search
m (1 revision(s))
m (Robot: Changing Category:Database Access)
Line 14: Line 14:
  
 
{{PDL1}}
 
{{PDL1}}
[[Category: Database Access]]
+
 
 +
[[Category:Documentation/Developers Guide/Database Access]]

Revision as of 11:39, 4 June 2008



To add an index, the same programmatic logic is followed. Create an IndexDescriptor with the com.sun.star.sdbcx.XDataDescriptorFactory interface from the index container. Then follow the same steps as for the table. Next, append the columns to be indexed.

Note that only an index can be added to an existing table. It is not possible to add an index to a TableDescriptor.

The task is completed when the index object is added to the index container, unless the append() method throws an com.sun.star.sdbc.SQLException. This may happen when adding a unique index on a column that already contains values that are not unique.

Content on this page is licensed under the Public Documentation License (PDL).
Personal tools