Utility Functions and C Language Reference > Virtual Table Server Functions (VTS) for C, C#, and Java > Virtual Table Server (VTS) Functions for Multiple Connections > Alphabetical Listing > vtc_send_if_unique

vtc_send_if_unique

Deprecated. Use lrvtc_send_if_unique. Sets the last field of a column to a value if the value does not exist in the column.

C Language

VTCERR2 vtc_send_if_unique ( PVCI2 pvci, char *columnName, char *value, unsigned short *outRc );

C# Language

bool vts_multi.send_if_unique ( int pvci, string columnName, string value);

Java Language

int Vtc.send_if_unique (  long pvci, string columnName, string value, OutIntParameter outRc);
Data Update Functions

Arguments

Name Comments
pvci The server connection handle.
columnName The name of the column.
value The string to write to the field.
outRc The status of the operation: 1 - Pass or 0 - Fail

vtc_send_if_unique sets the last field of a column to a value if the value does not exist in the column. If the value already exists in the column, the function has no effect.

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 on. See vtc_ensure_index.

Return Values

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

C# Language: Returns true on success.

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

Parameterization

All string input arguments can be passed using standard parameterization.

Example

int rc;
unsigned short status = 0;
...

rc = vtc_send_if_unique(pvci, "H_question", "Question!", &status);
lr_log_message("send_message rc=%d\n", rc);
    

C# Language Example

.Net Multiple Connection Example

Java Language Example

Java Multi-Connection Example