This function serves for controlling and setting the admin mode of stored procedures and query evaluation. If this mode is enabled, the data and object privileges in the same scheme will not be checked during this procedure runtime. If the procedure in the admin mode calls another procedure from the same scheme, then this procedure will be running in admin mode too.
If the mode parameter equals TRUE, this function will enable the admin mode for a procedure or query name. If mode equals FALSE, the admin mode will be disabled. If mode equals NULL, the mode will not change, but you'll be able to get its current state from the return value.
The Admin_mode function with mode parameter other than NULL may be called only by a user in the Author role.
The name parameter may be set in the scheme_name.object_name form. If the scheme name is not set, the object is searched for in the current scheme.
Returns TRUE, if the name object was in the admin mode, FALSE otherwise.
Returns NULL on error (e.g. if the calling client is not a part of the Author role or if the name parameter specified a non-existing procedure).
CALL Admin_mode(APL1.PROC1, CATEG_PROC, TRUE);