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

From Apache OpenOffice Wiki
Jump to: navigation, search
m (Robot: Changing Category:Documentation/Developers Guide/Database Access)
m (FINAL VERSION FOR L10N)
 
Line 6: Line 6:
 
|NextPage=Documentation/DevGuide/Database/Creating a User
 
|NextPage=Documentation/DevGuide/Database/Creating a User
 
}}
 
}}
{{DISPLAYTITLE:Adding an Index}}
+
{{Documentation/DevGuideLanguages|Documentation/DevGuide/Database/{{SUBPAGENAME}}}}
 +
{{DISPLAYTITLE:Adding an Index}}
 
To add an index, the same programmatic logic is followed. Create an <code>IndexDescriptor</code> with the <idl>com.sun.star.sdbcx.XDataDescriptorFactory</idl> interface from the index container. Then follow the same steps as for the table. Next, append the columns to be indexed.  
 
To add an index, the same programmatic logic is followed. Create an <code>IndexDescriptor</code> with the <idl>com.sun.star.sdbcx.XDataDescriptorFactory</idl> interface from the index container. Then follow the same steps as for the table. Next, append the columns to be indexed.  
  

Latest revision as of 12:52, 15 May 2009



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
In other languages