DBWLoadQuery1

<< Click to Display Table of Contents >>

Navigation:  Programming Mechworks PDM > DBWCommandShell > Library Reference > Database >

DBWLoadQuery1

Description

Similar to DBWLoadQuery but allowing the specification of the result type.

Syntax

Sub DBWLoadQuery1(Title, Query, QueryTypeString)

Parameters

Title

a name for the query to load

Query

sql statement

QueryTypeString

the type of query to perform; possible values are:

"WORKINGSET" : fills the TreePage WorkingSet tab with query results

"SELECTION" : fills the QueryPage grid with results

"FILTER" : refines the currently selected records.
in TreePage it fills the Search tab results
in QueryPage it fills the main grid;
Query must be of the format

AND <condition>

Remarks

when specified the QueryTypeString as "WORKINGSET" you've to pass a list of uids formatted as string:

100,101,102,103

 

if the string containing uids is larger than 4096 characters, you've to define it as follows:

100,
101,
102,
103

 

In case the list of unique_ids is greater than 8k chars, a database table named DBW_WS_<userName> will be created to manage the data

Example

DBWLoadQuery with large working sets

Results

It loads a query in the QueryPage and let you choose to obtain results in a simple selection or in working set in the TreePage.

See also

Sub DBWLoadQuery

Example

Sub Main()
    title = "Only_projects"
    query = "SELECT * FROM DOCUMENT WHERE T='0'"
    DBWLoadQuery1 title, query, "SELECTION"
end sub

 

Sub Main()
    title = "My Working Set"
    query = "15,16,17,1003,2005"
    DBWLoadQuery1 title, query, "WORKINGSET"
end sub

 

Sub Main()
    title = "Filtering"
    query = "AND T='D'"
    DBWLoadQuery1 title, query, "FILTER"
end sub