SQL

​​BluInsights 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.

 

SQL Object creation

CREATE <modifier> <object kind> <id>

DECLARE <modifier> <object kind> <id>

CREATE <modifier> <id> <object kind>

DECLARE <modifier> <id> <object kind>

modifier is optional and can be :

  • UNIQUE
  • FORCE
  • PUBLIC

object kind is mandatory is one of :

  • TABLE
  • INDEX
  • VIEW
  • PROCEDURE
  • TRIGGER
  • ALIAS
  • TABLESPACE
  • DATABASE
  • CURSOR
  • SYNONYM
  • PARTITION

id is the identifier of a defined SQL 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.

 

Creation in/on

CREATE <modifier> <object kind> <id> (IN|ON) <parent id>

​A link ​from the query source file to the referenced node identified by parent id will be created.

 

Alias targets

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 referenced node  identified by alias target will be created

SYNONYM’s targets are treated like this

Trigger targets

(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

 

Queries

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 <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.