srv_pfield

Returns a field from an SRV_PROC structure.

Syntax

DBCHAR * srv_pfield (
SRV_PROC *
srvproc,
int
field,
int *
len );

where

srvproc
Is a pointer to the SRV_PROC structure that is the handle for a particular client connection. The structure contains the information that the ODS Library uses to manage communication and data between the Open Data Services server application and the client.
field
Specifies the srvproc field to return. The following list provides the possible values for field and what these values return:
Field value Returns
SRV_APPLNAME The application name that the client supplied when it logged in to the Open Data Services server application.
SRV_BCPFLAG A flag that is TRUE if the client is preparing for a bulk copy operation; otherwise, FALSE.
SRV_CLIB The name of the library that enables the client to talk to a server.
SRV_CPID The process ID of the client process on the client's source machine.
SRV_EVENT The current event for srvproc.
SRV_HOST The host name used by the srvproc client application when it logged on to the Open Data Services server application.
SRV_LIBVERS The version of the client library.
SRV_LSECURE A flag. TRUE if client connection is a trusted connection; otherwise, FALSE. For a gateway, TRUE if the client requested a trusted connection (for example, when a DB-Library client uses DBSETLSECURE). For an extended stored procedure, TRUE if SQL Server established a trusted connection.
SRV_NETWORK_MODULE The name of the Net-Library DLL used for the current srvproc connection.
SRV_NETWORK_VERSION The version of the Net-Library DLL used for the current srvproc connection.
SRV_NETWORK_CONNECTION The connection string passed to the Net-Library DLL used for the current srvproc connection.
SRV_PIPEHANDLE A string containing the pipe handle of a connected client, or NULL if the client is connected on a network that does not use named pipes. To use this handle as a valid pipe handle with Windows NT, convert this string to an integer.
SRV_PWD The user password used by the srvproc client application when it logged on to the Open Data Services server application.
SRV_RMTSERVER The server from which the client process is logged on. If the logon is from a client, this value will be an empty string.
SRV_ROWSENT The number of rows already sent by srvproc for the current set of results.
SRV_SPID The server thread ID of the srvproc. For extended stored procedures, this value is the same as the kpid column of sysprocesses, and it can change over time.
SRV_STATUS The current status of srvproc.
SRV_TDS The version of the tabular data stream (TDS) used by the client. Use SRV_TDSVERSION instead of this value.
SRV_TYPE The connection type of srvproc. If "server" is returned, srvproc is from a SQL Server. If "client" is returned, srvproc is from a DB-Library or ODBC client.
SRV_USER The user name used by the srvproc client application when it logged on to the Open Data Services server application.

len
Is a pointer to an integer variable that contains the length of the returned field value. If len is NULL, the length of the string isn't returned.

Returns

A pointer to a null-terminated string containing the current value for the specified field in the SRV_PROC structure. If the field is empty, a valid pointer to an empty string is returned and len contains 0. If the field is unknown, NULL is returned and len contains the value -1.

Remarks

This function returns a pointer to a null-terminated string containing the current value for the required field in the SRV_PROC structure. It also returns the length of the string.

See Also

This entry For information about
srv_sfield Returning a field from an SRV_SERVER structure
srv_symbol Converting an Open Data Services token value to a readable string
SRV_TDSVERSION Returning TDS version information for a client