Applying complex Query
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2025 08:38 AM
Hello,
I have an issue querying the sys_dictionary table with a complex query of this type :
CdtA AND ( CdtX OR CdtY OR (CdtZ1 AND CdtZ2))
Cdt : condition
Problem : cannot put a mix of OR and AND in the conditions
I have developed the expression with boolean logic :
(CdtX AND CdtA ) OR (CdtY AND CdtA ) OR (CdtZ1 AND CdtZ2 AND CdtA))
The query become much slower (the CdtA is so long and its applied three times this time)
Does anyone have an idea to apply this type of complex queries easily??
here is the actualy qeury :
constructQueries: function(objectTable, allDataTables, tablesToSkip) {
var tableLabel = this.getTableLabel(objectTable);
// QUERIES
// dict entries of type reference and the reference is twoards the object type (eg. Group)
var referencesQuery = 'referenceCONTAINS' + tableLabel;
// dict entries of type script
var scriptsQuery = 'internal_typeLIKEscript';
// var documentQuery = 'internal_type=document_id';
// var conditionsQuery = 'internal_type=conditions';
var stringScriptQeury = 'internal_type.label=string^elementLIKEscript';
// exclude all data entries of specifique tables
var skipTablesQuery = 'nameNOT LIKE' + tablesToSkip.join('^nameNOT LIKE');
return {
mainQuery: referencesQuery + '^' + skipTablesQuery + '^NQ' + scriptsQuery + '^' + skipTablesQuery + '^NQ' + stringScriptQuery + '^' + skipTablesQuery
};
},
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2025 02:41 AM
Hello @youssef_effat
Could you please give me more input on this