Sybase Technical Library - Product Manuals Home
[Search Forms] [Previous Section with Hits] [Next Section with Hits] [Clear Search] Expand Search

Syntax [Table of Contents] Return values

Open Client Client-Library/C Reference Manual

[-] Chapter 3 Routines
[-] ct_get_data
[-] Parameters

Parameters

cmd

A pointer to the CS_COMMAND structure managing a client/server operation.

item

An integer representing the data item of interest. When using ct_get_data to retrieve data for more than one item in a result set, item can only be increased by; that is, an application cannot retrieve data for item number 3 after it has retrieved data for item number 4.

When retrieving a column, item is the column's column number. The first column in a select-list is column number 1, the second is number 2, and so forth.

When retrieving a compute column, item is the column number of the compute column. Compute columns are returned in the order in which they are listed in the compute clause. The first column returned is number 1.

When retrieving a return parameter, item is the parameter number. The first parameter returned by a stored procedure is number 1. Stored procedure return parameters are returned in the same order as the parameters were originally specified in the stored procedure's create procedure statement. This is not necessarily the same order as specified in the RPC command that invoked the stored procedure. In determining what number to pass as item do not count non-return parameters. For example, if the second parameter in a stored procedure is the only return parameter, pass item as 1.

When retrieving a stored procedure return status, item must be 1, as there can be only a single status in a return status result set.

buffer

A pointer to data space. ct_get_data fills *buffer with a buflen-sized chunk of the column's value.

buffer cannot be NULL.

buflen

The length, in bytes, of *buffer.

If buflen is 0, ct_get_data updates the I/O descriptor for the item without retrieving any data.

buflen is required even for fixed-length buffers, and cannot be CS_UNUSED.

outlen

A pointer to an integer variable.

If outlen is supplied, ct_get_data sets *outlen to the number of bytes placed in *buffer.


Syntax [Table of Contents] Return values