DSL Syntax

Using the following sample DSL syntax, the "rest/execute/v1/actions/ dsl/invoke" REST API can be executed to Create, Update and Delete sql script procedures. The word "script" is used mainly in the DSL syntax because the subtype of a procedure is "script".

 

DROP SCRIPT (IF EXISTS)? /path/name
 
———————————————————————————————————————————————————————————————
 
CREATE SCRIPT (IF NOT EXISTS)? /path/name
DEFINE AS  script
(SET PROPERTIES {"name":{value}})?
(SET ANNOTATION 'this is a script created using DSL api' | NULL)?
 
———————————————————————————————————————————————————————————————
 
ALTER SCRIPT /path/name (RELOCATE AS /path/newName)?
(RELOCATE AS /newPath/newName)?
(DEFINE AS  script)?
(SET PROPERTIES {"name":{value}})?
(SET ANNOTATION 'this is a script altered using DSL api' | NULL)?
 
———————————————————————————————————————————————————————————————
 
SELECT * FROM model.ALL_RESOURCE_PROPERTIES WHERE
        PROPERTY_NAME = 'propName' AND
        METADATA_ID =
            (SELECT PROCEDURE_ID FROM model.ALL_PROCEDURES
            WHERE PROCEDURE_NAME = 'name' AND       //name of script
            PARENT_PATH = '/path');                 //parent path of the script