CREATE MODULE -> <module-name> +---------------------------------+-+ +-> STORED NAME IS <stored-name> -+ | +------------------------------------<-----------------------------+ +-+-------------------+---+----------------------------+-----------+ +-> LANGUAGE SQL ---+ +-> AUTHORIZATION <auth-id> -+ | +------------------------------------------------------------------+ ++---------------------------------+-+--------------------+--------+ +-> COMMENT IS -+-> 'string' ---+-+ +-> declare-clause --+ | +------ / <-----+ | +------------------------------------------------------------------+ +-+-> routine-clause ---+--> END MODULE ---> +-------- <-----------+ declare-clause = --+-+-> declare-transaction-statement -----------+-+--> | +-> declare-local-temporary-table-statement -+ | | +-> declare-variable-statement --------------+ | +----------------------<-------------------------+ routine-clause = -+> PROCEDURE <procedure-name> +-+-------------------> -----------++ +> FUNCTION <function-name> --+ +> STORED NAME IS <stored-name> -+| +----------------------------------------- <-----------------------+ +---+--------------------> ---------------------+---+ +--> ( -+----------------------------+-- ) -+ | ++-> parameter-decl --------++ | +----------- , <-----------+ | +---------------------------------------------------+ ++----------------------------++----------------------+---------+ +> RETURNS result-data-type -++---> function-attr ---+ | +------------------------------------------ <-------------------+ ++--------------------------------+-> ; -+-> compound-statement -----+> ; --> +> routine-attr -----------------+ +-> compound-use-statement -+ +-> external-body-clause ---+ parameter-decl = --+----------++---------------------++-> data-type -----+---+ +-> IN ----++-> <parameter-name> -++-> <domain-name> -+ | +-> OUT ---+ | +-> INOUT -+ | +------------------------------<--------------------------+ +-+---------------------+-+-----------------------+-------+ +-> mechanism-clause -+ +-> DEFAULT value-expr -+ | +---------------------------------------------------------+ +--+--------------------------------+-------------------------> +-> COMMENT IS -+-> 'string' ---++ +------ / <-----+ function-attr = -++--------+-+-> VARIANT -------++-> |+-> NOT -+ +-> DETERMINISTIC -+| +--> LANGUAGE SQL --------------+ routine-attr = --+-> COMMENT IS --+-> 'string' --+-+--> | +------ , <----+ | +-> USAGE IS -+-> LOCAL ---+------+ +-> GLOBAL --+