To distribute an application and a database without disclosing the logic contained within procedures, functions, triggers, events, and views, you can obscure the contents of these objects using the SET HIDDEN clause of the ALTER PROCEDURE, ALTER FUNCTION, ALTER TRIGGER, ALTER EVENT and ALTER VIEW statements.
You must be the owner of the object, have the ALTER ANY OBJECT system privilege, or have one of the following privileges:
Procedures and functions ALTER ANY PROCEDURE system privilege
Views ALTER ANY VIEW system privilege
Events MANAGE ANY EVENT system privilege
Context and remarks
The SET HIDDEN clause obfuscates the contents of the associated objects and makes them unreadable, while still allowing the objects to be used. You can also unload and reload the objects into another database.
The modification is irreversible, and deletes the original text of the object. Preserving the original source for the object outside the database is required.
Debugging using the debugger does not show the procedure definition, nor does procedure profiling display the source.
Setting the preserve_source_format database option to On causes the database server to save the formated source from CREATE and ALTER statements on procedures, views, triggers, and events, and put it in the appropriate system view's source column. In this case both the object definition and the source definition are hidden.
However, setting the preserve_source_format database option to On does not prevent the SET HIDDEN clause from deleting the original source definition of the object.
Use the appropriate ALTER statement with the SET HIDDEN clause.
|Hide an individual object||
Execute the appropriate ALTER statement with the SET HIDDEN clause to hide a single procedure, function, trigger, event, or view.
|Hide all objects of a specific type||
Execute the appropriate ALTER statement with the SET HIDDEN clause in a loop to hide all procedures, functions, triggers, events, or views.
Execute the following loop to hide all procedures:
BEGIN FOR hide_lp as hide_cr cursor FOR SELECT proc_name, user_name FROM SYS.SYSPROCEDURE p, SYS.SYSUSER u WHERE p.creator = u.user_id AND p.creator NOT IN (0,1,3) DO MESSAGE 'altering ' || proc_name; EXECUTE IMMEDIATE 'ALTER PROCEDURE "' || user_name || '"."' || proc_name || '" SET HIDDEN' END FOR END;
Discuss this page in DocCommentXchange.
|Copyright © 2014, SAP AG or an SAP affiliate company. - SAP Sybase SQL Anywhere 16.0|