5.3.2 DB_view Objects

class Db_view( )
Creates a Db_view object. DB_view objects generate rowsets from a SQL query. They provide functions to parse and evaluate the rowsets.

Db_view objects have the following methods:

col( column)
Returns the value in column. The first column of the rowset has the index 1. If the type of the column is not supported, a TypeError is raised. See Table 5.1 for a list of supported data types.

col_count( )
Returns the number of columns defined in the rowset.

col_length( column)
Gets the length of the value in column. Empty columns have a length of zero; non-empty numerical and date/time columns have a length of 1. For text columns, the length is the character count, and for binary columns, the length is the byte count.

col_raw( column)
Extracts the value of column as raw binary data, and returns it as a Python string. The first column of the rowset has the index 1. See Table 5.1 for a list of supported data types.

col_rawtime( column)
Extracts the value of a date/time column at index column as a long integer, which represents the raw Symbian time value. The first column of the rowset has the index 1. See Table 5.1 for a list of the supported data types.

col_type( column)
Returns the numeric type of the given column as an integer from a Symbian-specific list of types. This function is used in the implementation of method col.

count_line( )
Returns the number of rows available in the rowset.

first_line( )
Positions the cursor on the first row in the rowset.

get_line( )
Gets the current row data for access.

is_col_null( column)
Tests whether column is empty. Empty columns can be accessed like normal columns. Empty numerical columns return a 0 or an equivalent value, and text and binary columns have a zero length.

next_line( )
Moves the cursor to the next row in the rowset.

prepare( db, query)
Prepares the view object for evaluating an SQL select statement. db is a Dbms object and query the SQL query to be executed.

See About this document... for information on suggesting changes.