[ Previous ] [ Contents ] [ Index ] [ Next ]

Ns_DbBestRowId

Overview

Get a list of columns that uniquely identifies a row

Syntax

    char *Ns_DbBestRowId (
    	Ns_DString  *pds,
    	Ns_DbHandle *handle,
    	char        *table
    );

Description

The Ns_DbBestRowId function returns a list of the column names that uniquely identify a row in the specified table. Upon completion, the returned pointer points to a list of column names in the following format:

    "column1\0column2\0column3\0\0"

Example

    
    char *columnNameList;

    Ns_DbHandle *handle;
    Ns_DString ds;
    

if ((handle = Ns_DbPoolGetHandle("aPoolName")) != NULL) {

    	Ns_DStringInit(&ds);	
    	columnNameList = Ns_DbBestRowId(&ds, handle, "aTable");
    	while (*columnNameList != '\0') {
       		printf("%s\n", columnNameList);
       		columnNameList += strlen(columnNameList) + 1;
    	}
    	Ns_DStringFree(&ds);
    }

Top of Page

[ Previous ] [ Contents ] [ Index ] [ Next ]
Copyright © 1996 America Online, Inc.