close()  commit()

Chapter 5: General Objects and Methods

columnInfo()

Description

Retrieves data from a specified column in a specified table, such as column type, storage length, precision, and scale attributes, and places the data in the object accessed by the dest value.

NoteTo ensure that dest points to the object in which to have the retrieved column information placed, use the bysymbol() function on that object, then pass the returned symoff value into the method, as in the example below. For more information, see the “Introduction”.

Syntax

columnInfo(symoff dest, string tablename, string colname);

Pattern

Description

dest

symoff to an object to hold the incoming data.

tablename

The name of the table that contains the column with the desired data.

colname

The name of the column that contains the desired data.

Return value

Integer. Returns a positive integer if successful, and zero or negative integer, if failed.

Usage

Pointer to object

Object

pdbi->columnInfo(bysymbol    (out),tbl,col);

string tbl; string col; string out; int rv; tbl = “authors”; col = “city”; rv = my_cldbi.columnInfo(bysymbol    (out),tbl,col); if(!rv) erm(“columnInfo() FAIL “); else { erm(“columnInfo() PASS “)’ out.debug() }





Copyright © 2005. Sybase Inc. All rights reserved. commit()

View this book as PDF