Utility Functions and C Language Reference > Virtual Table Server Functions (VTS) for C, C#, and Java > Virtual Table Server (VTS) Functions for Single Connection > Alphabetical Listing > lrvtc_ensure_index

lrvtc_ensure_index

Creates an index on a column.

C Language

VTCERR2 lrvtc_ensure_index ( char *columnName );

C# Language

void vts.ensure_index ( string columnName );

Java Language

int Lrvtc.ensure_index ( string columnName );
Global Functions

Arguments

Name Comments
columnName The name of the column to index.

lrvtc_ensure_index creates a column index. If a column is not indexed, the time required to execute a lrvtc_send_if_unique call increases with the number of rows. If the column is indexed, the time for 'send if unique' operations is constant. For large databases, we recommend that you index columns you want to perform 'send if unique' operations.

A column is locked while an index is being built on it. Any function calls that change the column are queued until the index build completes.

If the index exists, this function has no effect.

Return Values

C Language:   Returns zero on success or one of the Error Codes.

C# Language: No return value.

Java Language:   Returns zero on success or one of the Error Codes.

Parameterization

All string input arguments can be passed using standard parameterization.

C Language Example

VTCERR2 rc = 0;

rc = lrvtc_create_column("Name");
if(rc) {lr_error_message("Create column failed.");}

rc = lrvtc_ensure_index("Name");
if(rc) {lr_error_message("Index operation failed.");}

   

C# Language Example

.Net Single Connection Example

Java Language Example

Java Single Connection Example