SQL Queries - CAST Knowledge Base - Queries on Links - How to manually ignore dynamic links normally handled by the Dynamic Link Manager
Purpose of Query
This page help you to manually ignore dynamic links normally handled by the Dynamic Link Manager.
Applicable CAST Version
| Release | Yes/No |
|---|---|
| 8.3.x | ✅ |
| 8.2.x | ✅ |
Applicable RDBMS
| RDBMS | Yes/No |
|---|---|
| Oracle Server | ❓ |
| Microsoft SQL Server | ❓ |
| CSS | ✅ |
Query for CSS
First, develop the query for the links you wish to ignore. Here is the query for all the dynamic links:
SELECT a.idacc,
clr.keynam,
clr.objtyp,
cle.keynam,
cle.objtyp
FROM acc a
JOIN keys clr
ON a.idclr = clr.idkey
AND a.prop & 1 = 1
AND a.prop & 65536 = 0
JOIN keys cle
ON cle.idkey = a.idcle
Query result example
98076560;“bvoipTNCountRequest.jsp”;274;“BVoIP_TN_Count_Request_help.html”;274
98254368;“BVoIPMasterSlaveMapping.jsp”;274;“BVoIP_Master_Slave_Mapping_window.html”;274
98222979;“uvpBrxRoutingQuery.jsp”;274;“UVP_BRX_Routing_Query_Help.html”;274
98176953;“addSipServerFqdn.jsp”;274;“UVP_Add_SIP_Server_FQDN_Help.html”;274
98126323;“networkElementDetail.jsp”;274;“NetworkElementDetail_window.htm”;274
Query result interpretation
This returns the id of link, the objects that form the link, and the objects type
If you need to see the specific types, you can see the details for the caller types with this query:
SELECT *
FROM typ
WHERE idtyp IN (SELECT DISTINCT clr.objtyp
FROM acc a
JOIN keys clr
ON a.idclr = clr.idkey
AND a.prop & 1 = 1
AND a.prop & 65536 = 0
JOIN keys cle
ON cle.idkey = a.idcle) limit 10
Query result example
514;“C_METHOD”;“C++ Method”;“ACTIVE "
516;“C_FUNCTION”;“C/C++ Function”;“ACTIVE "
565;“C_GLOBALVARIABLE”;“C/C++ Global Variable”;“ACTIVE "
900;“JV_ENUM”;“Java Enum”;“ACTIVE "
101;“JV_CTOR”;“Java Constructor”;“ACTIVE "
Query result interpretation
This query returns the detail of the caller types: Id, name, type and status
and the callee types with this query:
SELECT *
FROM typ
WHERE idtyp IN (SELECT DISTINCT cle.objtyp
FROM acc a
JOIN keys clr
ON a.idclr = clr.idkey
AND a.prop & 1 = 1
AND a.prop & 65536 = 0
JOIN keys cle
ON cle.idkey = a.idcle);
Query result example
290;“JSP_SERVLET_MAPPING”;“Servlet Mapping”;“ACTIVE "
363;“JSP_PROPERTY_MAPPING”;“Java Property Mapping”;“ACTIVE "
367;“JSP_ACTION_MAPPING”;“Struts Action Mapping”;“ACTIVE "
141190;“CAST_JEE_StrutsValidator”;“Struts Validator”;“ACTIVE "
136009;“HIB_ENTITY”;“Hibernate Entity”;“ACTIVE "
Query result interpretation
This query returns the detail of the calle types: Id, name, type and status
So for example if you want to ignore links with a caller of type “caller_type” and a callee of type"caller_type” you can use this specific query to list the links:
SELECT a.idacc,
clr.keynam,
clr.objtyp,
cle.keynam,
cle.objtyp
FROM acc a
JOIN keys clr
ON a.idclr = clr.idkey
AND a.prop & 1 = 1
AND a.prop & 65536 = 0
AND clr.objtyp = <caller_type>
JOIN keys cle
ON cle.idkey = a.idcle
AND cle.objtyp = <callee_type>;
if you want to ignore links with a caller of type 137251 and a callee of type 138017 then the previous query will be as follow:
SELECT a.idacc,
clr.keynam,
clr.objtyp,
cle.keynam,
cle.objtyp
FROM acc a
JOIN keys clr
ON a.idclr = clr.idkey
AND a.prop & 1 = 1
AND a.prop & 65536 = 0
AND clr.objtyp = 137251
JOIN keys cle
ON cle.idkey = a.idcle
AND cle.objtyp = 138017;
Query result example
9244699;“GetUnsent”;137251;“EQUIPE”;138017
9317460;“LoadAll”;137251;“TECHNO_WAN”;138017
9252938;“LoadAll”;137251;“COLLECTE_ACTE”;138017
9227572;“Load”;137251;“LED_CPL”;138017
Query result interpretation
list links with a caller of type 137251 and a callee of type 138017
Once you have validated the links you want to ignore, then you can do the following - as a precaution you should back up your KB prior to these steps (example below is with the specific query above for efile caller and JSP_FORWARD callee):
CREATE TABLE in_ignore_link
(
idacc INT NOT NULL,
ignore_mode INT NOT NULL,
idfus INT NULL
);
INSERT INTO in_ignore_link
(idacc,
ignore_mode)
((SELECT a.idacc,
-1
FROM acc a
JOIN keys clr
ON a.idclr = clr.idkey
AND a.prop & 1 = 1
AND a.prop & 65536 = 0
AND clr.objtyp = 274
JOIN keys cle
ON cle.idkey = a.idcle
AND cle.objtyp = 958));
SELECT Tb_ignoredlink();
DROP TABLE in_ignore_link;
FYI - for the IN_IGNORE_LINK table, -1 to ignore ; +1 to reset; TB_IgnoredLink procedure may take some time to run
You can also mark individual links remaining as reviewed if you insert the links ID (IDACC) and the ID of the project from which it comes (IDPRO) into the table DYNLINKS_TREATED. This will make the link disappear from the DLM window without the need to actually delete the link or to reanalyze using ExternalLinksRules.xml.
Query for Oracle
Query result example
Query result interpretation
Query for SQL server
Query result example
Query result interpretation
Notes/comments
Related Pages