Share this page

# vtc_ensure_index

Deprecated. Use lrvtc_ensure_index. Creates an index on a column.

## C Language

    VTCERR2 vtc_ensure_index ( PVCI2 pvci,  char *column_name, unsigned short *outRc );

## C# Language

    bool vts_multi.ensure_index ( long pvci,  string column_name);

Global Functions

## Arguments

Name | Comments
--- | ---
pvci | The server connection handle.
column_name | The name of the column to index.
outRc | The return status. 1 - Pass or 0 - Fail

vtc_ensure_index creates a column index. If a column is not indexed, the time required to execute a vtc_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: Returns true on success.

## Parameterization

All string input arguments can be passed using standard parameterization.

## C Language Example

    int      rc = 0;
    unsigned short outrc;
    PVCI2     pvci = 0;
    ....
    rc = vtc_ensure_index(pvci, "C_credit", &outrc);
    lr_log_message("ensure_index rc=%d\n", outrc);

## C# Language Example

.Net Multiple Connection Example

Tips to improve your search results... VuGen Function Reference Version 25.1-25.3 Function Reference 25.1-25.3 All View Local Help Center View Online Help Center Version: