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.
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
(BEFORE|AFTER|INSTEAD OF) INSERT|DELETE|UPDATE OF <trigger conditions> ON <observe element>
A link from the query source file to the referenced node identified by observe element will be created
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 <object 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 object id 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.