TOC PREV NEXT INDEX

DBlist

Synopsis

DBlist formats the columns of data into an array of strings corresponding to data rows.

Input Ports

column_array[] DBcolumn group

num_rows_to_list int

header_mode int

column_mode int

column_width int

active_mode int

Parameters

num_columns int

Output Ports

message string

return_code int

list_string[] string

Description

DBlist formats the columns of data returned by DBquery into an array of strings. Each string corresponds to one row of data and is a concatenation of the same-indexed entry in each of the columns of returned data. For example, the third array string would consist of the third item of the first column of data, followed by the third item in the second column of data, and so forth.

This module is typically used to convert the data returned by DBquery into a form that can be displayed in an UIwindow. Additional parameters allow you to specify how the array strings appear when displayed in a UIwindow: header information, single-column versus multicolumn display format, and spacing between rows.

Input ports

Input

column_array[]

The data returned by a SELECT statement. This is the output of a DBquery module. Each element in this array is a DBcolumn group that consists of an array containing a column of returned data, an integer value that indicates whether null data values are present, the value that is to be used to represent a null data value, and the name of the column.
For more information, see DBcolumn.

num_rows_to_list

The number of array strings (data rows) to be created.
header_mode
A value specifying whether and how the header is to be constructed, as follows
0: No header is constructed.
1: The header includes column names only.
2: The header includes column names and datatypes.

column_mode

A value specifying whether single or multiple columns should be used when displaying the array strings (data rows) in a UIwindow. A value of 0 displays the elements of each string in a single column; a value of 1 displays the elements in the number of columns specified by the num_columns parameter.

column_width

A value specifying the width, in characters, of a column.

active_mode

A value specifying whether changes to DBlist parameters are processed. A value of 0 does not process the changes; a value of 1 processes the changes. Specifying 0 saves processing time and is useful when the array strings are not being displayed in a UIwindow.

Parameters

num_columns

The number of array elements (columns) in column_array[].

Output Port

message

A message that describes the status of the formatting operation. For a list of possible values, see The Toolkits Book.

return_code

The status code associated with the message returned in the message parameter. A value of 0 indicates success; a nonzero value indicates failure. For a list of possible values, see The Toolkits Book.

list_string[]

The array of strings produced by the formatting operation. Each string corresponds to one row of data and is a concatenation of the same-indexed entry in each of the columns of returned data.

Example

Not available.

File

v/db.v

See also related modules



TOC PREV NEXT INDEX