poIQueryCtrl GetIteratorHandle
Creates and returns a handle to the QueryIterator object that allows you to iterate through query results.
Syntax
poIQueryCtrl_handle GetIteratorHandle name
Application
HyperView Tcl Query
Description
This command creates and returns a handle to the QueryIterator object that allows you to
iterate through query results.
Note: QueryIterator allows you to iterate query results one
row at a time. QueryIterator is a snapshot of the Query Control object state and is only
valid for the current model, current simulation, current query, and current selection
set.
Inputs
- name
- The name of the iterator handle.
Example
proc QueryData {model selection query_string {output stdout}} {
# get query control handle
$model GetQueryCtrlHandle Query1
# set query parameters
Query1 SetQuery $query_string
Query1 SetSelectionSet [$selection GetID]
# query
Query1 GetIteratorHandle iter1
# output data ...........................
if { $output == "stdout" } {
# output to console
while { [iter1 Valid] }
puts [iter1 GetDataList]
iter1 Next
}
} else {
# output to user-defined stream
Query1 WriteData $output
}
# cleanup
iter1 ReleaseHandle
Query1 ReleaseHandle
}
Errors
Returns 0 if successful, otherwise an error code (HW_Error).