DBWFilter

<< Click to Display Table of Contents >>

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

DBWFilter

Description

It makes available from the command shell interface the Filter functionality available in the browser Document and Query pages.

Syntax

Function DBWFilter(FilterTitle, FilterQuery, Type, FilterAllTables, FilterAllDB)

Parameters

FilterTitle

the title of the filter query; a file with name <filter title>.TXT will be created in the %TEMP% directory.

FilterQuery

it is the filter query.
It must be of the syntax valid for the WHERE clause of the SQL language; the filter query may be splitted in more than one line.
It can be set to the special value of "RESET" to reset all the filters in the list.

Type

The type of action to be poerformed. Can assume following values:
"A" sets the Document Page as active page and applies the filter to the Assembly grid
"P" sets the Document Page as active page and applies the filter to the Part grid
"D" sets the Document Page as active page and applies the filter to the Drawing grid
"G" sets the Document Page as active page and applies the filter to the Generic grid
"0" (zero) sets the Document Page as active page and applies the filter to the Project grid
"QUERY" sets the Query Page as active page and applies the filter to the Generic grid

FilterAllTables

if "0" it applies the filter only to the grid specified in type parameter
if "1" it applies the filter to all the grid indipendently from the value in type

FilterAllDB

if "0" it applies the filter only to the current recordset loaded in the browser
if "1" it applies the filter to all databases

Example

'reset the filter
DBWFilter "resetFilter", "RESET","A",0,0
'filter the part grid for IDs tha have a ..64.. in the identifier
DBWFilter "have64in","ID LIKE '%64%'","P",0,0
'filter all the tables and all the database for the IDs beginning with 53200220
DBWFilter "beginWith53200220", "ID LIKE '53200220%'", "A", 1, 1
'filter the query grid for IDs that have a ..64.. in the identifier
DBWLoadQuery "QueryAllParts","SELECT * FROM DOCUMENT WHERE T='P'"
DBWFilter "queryPagehave64in", "ID LIKE '%64%'", "QUERY", 0, 0