AWS Blu Insights detects SQL invocations from program files such as Cobol and PL/I and creates adequate links between those files (e.g. COB) and .SQL ones.
CREATE (OR REPLACE)? <modifier> <object kind> <id>
DECLARE <modifier> <object kind> <id>
CREATE (OR REPLACE)? <modifier> <id> <object kind>
DECLARE <modifier> <id> <object kind>
modifier is optional and can be :
object kind is mandatory and is one of :
<id>
is the identifier of a defined SQL object system name
is an alias to the object name defined at the creation of the object.
A node identified with <id>
and a type set to <object kind>
will be created and a link from the query source file to the created node.
For the creation of the View object, a link will be formed from view object <id>
to the SQL objects used in SQL sub queries. For the below sample SQL query, a dependency link is formed from VIEW1
object to the TABLE1
object.
CREATE VIEW VIEW1 (COL1, COL2) AS SELECT COL1, COL2 FROM TABLE1;
For the creation of the Trigger object, a link will be formed from trigger object <id>
to the SQL objects used in ON
statement. For the below sample SQL query, a dependency link is formed from TRIGGER1
object to the TABLE1
object.
CREATE TRIGGER TRIGGER1 BEFORE ON TABLE1;
..... EXECUTE <object id>
The command EXECUTE
is part of TRIGGER
creation. A dependency link from the TRIGGER
object will be created to the object id
. Object id refers to FUNCTION or PROCEDURE.
CALL <target id>
A link from the query source file to the referenced procedure or external program identified by target id
will be created.
CREATE (OR REPLACE)? <modifier> <object kind> <id> (IN|ON) <parent id>
A link from the query source file to the object <id>
and also from the object <id>
to the referenced node identified by <parent id>
will be created.
CREATE (OR REPLACE)? <modifier> <object kind> <id> FOR SYSTEM NAME <system id>
A link from the query source file to the referenced node identified by id or system id will be created.
DELETE FROM <table id> (WHERE <condition>)
DROP <object kind> (IF EXISTS) <id>
A link from the query source file to the referenced node identified by table id or id will be created.
CREATE (OR REPLACE)? ALIAS <alias id> (<sub query>) FOR <alias target>
DECLARE (OR REPLACE)? ALIAS <alias id> (<sub query>) FOR <alias target>
A link from the query source file to the object <alias id>
and also from the object <alias id>
to the referenced node identified by <alias target>
will be created.
SYNONYM’s targets are treated like this
UPDATE <object id>
INSERT INTO <object id>
JOIN <object id> ON
FROM <object id> AS <alias>, <object id> … (;|HAVING|WHERE|JOIN|GROUP|ORDER)
ALTER <object kind> <object id>
A link from the query source file to the referenced node identified by object id will be created
CONSTRAINT <constraint id> (PRIMARY KEY|FOREIGN KEY|CHECK)
ADD (PRIMARY KEY|FOREIGN KEY|CHECK) <object id>
FOREIGN KEY <fk id> (…) REFERENCES <object id>
A link from the query source file to the referenced node identified by <constraint id>
and from <constraint id>
to the reference <object id>
typed 'Constraint on' will be created.
COMMENT ON <object description> <object id> IS
COMMENT ON <object id> ()
A link from the query source file to the referenced node identified by object id will be created.
object description can be one of following (not exhaustive)
– COLUMN
– CONSTRAINT <id2> ON
– CONSTRAINT <id2> ON DOMAIN
– DATABASE
– DOMAIN
– INDEX
– ROLE
– SCHEMA
– TABLE
– TABLESPACE
– VIEW
In a mainframe environment, a SQL query can use some mainframe elements, like SQL objects. The following object’s kinds represent those cases:
SQLC files are similar to SQL but with extra margins, the same analysis for SQL is done for SQLC files.