Contents Index Generated table class Get<Column> generated method

UltraLite Static C++ User's Guide
  C++ API Reference
    Generated table class

Get generated method


Prototype 

bool  Get (
ul_column_num  column-index,
value-declaration,
bool* is-null = UL_NULL );

value-declaration:
  ul_char * buffer-name, ul_length buffer-length
| p_ul_binary buffer-name, ul_length buffer-length
| DECL_DATETIME & date-value
| { DECL_BIGINT | DECL_UNSIGNED_BIGINT } & bigint-value
| unsigned char & char-value
| double & double-value
| float & float-value
| [ unsigned ] long & integer-value
| [ unsigned ] short & short-value

Description 

Gets a value of from a column, specified by index.

Parameters 

column-index    The number of the column. The first column in the table has a value of one.

value declaration    The arguments required to specify the value depend on the data type. Character and binary data must be mapped into buffers, with the buffer name and length specified in the call. For other data types, a pointer to a variable of the proper type is needed. For character data, the length parameter specifies the length of the C array including the space used for the terminator.

isNULL    If a value in a column is NULL, isNull is set to true. In this case, the value argument is not meaningful.

Returns 

true (1) if successful.

false (0) if unsuccessful.

Example 

The following example is part of a switch statement that gets values from rows based on their data type:

switch( tb.GetColumnType( colIndex ) ) {
case tb.S_LONG :
   ret = tb.Get( colIndex, longval );
   printf( "Long column: %d\n", longval );
   break;
...
See also 

Data types enumeration

Get method

Get<Column> generated method

GetColumnSize method


Contents Index Generated table class Get<Column> generated method