Showing results for 
Search instead for 
Do you mean 

Searching for a String within a Formula

by Siemens Experimenter Siemens Experimenter on ‎11-04-2016 10:51 AM

The following query searches for a string within the Formula of any Rulestream Property within all Applications, returning the Application, Part Family, and Property where it was found. 

 

Note:

 

  • In this example, MySearchText is the string being searched.
  • Enclose the search string within ‘%  %’
  • The search is not case sensitive

 

Usage:

 

  1. Open SQL Server Management Studio
  2. Expand the Databases folder
  3. Right-Click on the Rules Database to be searched
  4. Select New Query
  5. Paste the following into the Query window
  6. Replace MySearchText with the actual text to be searched
  7. Execute the query

 

SELECT A.[Name] As Application,
       PFam.[Name] As PartFamily,
       PC.[Name] As Property,
       PF.[Prop_Con_Id],
       PF.[Formula_Type],
       PF.[Formula]
  FROM [dbo].[Application] A, [dbo].[Property_Formula] PF, 
       [dbo].[Property_Constraint] PC, [dbo].[Part_Family] PFam
  WHERE Formula LIKE '%MySearchText%'
  AND PF.[Prop_Con_Id] = PC.[Prop_Con_Id]
  AND PC.[Owner_Part_Family_ID] = PFam.[Part_Family_ID]
  AND PFam.[App_ID] = A.[App_ID]

 

 

 

Contributors