Use this statement to modify a function. You must include the entire new function in the ALTER FUNCTION statement.
ALTER FUNCTION [ owner.]function-name function-definition
function-definition : CREATE FUNCTION syntax
ALTER FUNCTION [ owner.]function-name SET HIDDEN
ALTER FUNCTION [ owner.]function-name RECOMPILE
Syntax 1 The ALTER FUNCTION statement is identical in syntax to the CREATE FUNCTION statement except for the first word. Either version of the CREATE FUNCTION statement can be altered.
Existing permissions on the function are maintained, and do not have to be reassigned. If a DROP FUNCTION and CREATE FUNCTION were carried out, execute permissions would have to be reassigned.
Syntax 2 Use SET HIDDEN to scramble the definition of the associated function and cause it to become unreadable. The function can be unloaded and reloaded into other databases.
This setting is irreversible. If you will need the original source again, you must maintain it outside the database.
If SET HIDDEN is used, debugging using the debugger will not show the function definition, nor will it be available through procedure profiling.
Syntax 3 Use the RECOMPILE syntax to recompile a user-defined function. When you recompile a function, the definition stored in the catalog is re-parsed and the syntax is verified. The preserved source for a function is not changed by recompiling. When you recompile a function, the definitions scrambled by the SET HIDDEN clause remain scrambled and unreadable.
Must be the owner of the function or have DBA authority.
SQL/2003 Vendor extension.
In this example, you create an event that instructs the database server to carry out an automatic backup of the transaction log only, every hour, Monday to Friday between 8 A.M. and 6 P.M.. Then, you issue an ALTER EVENT statement to change the event to be every two hours, between 9 A.M. and 5 P.M., on Mondays, Wednesdays, and Fridays.
CREATE EVENT HourlyLogBackup SCHEDULE hourly_log_backup BETWEEN '8:00AM' AND '6:00PM' EVERY 1 HOURS ON ( 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday') HANDLER BEGIN BACKUP DATABASE DIRECTORY 'c:\\database\\backup' TRANSACTION LOG ONLY TRANSACTION LOG RENAME END; ALTER EVENT HourlyLogBackup ALTER SCHEDULE hourly_log_backup BETWEEN '9:00AM' AND '5:00PM' EVERY 2 HOURS ON ( 'Monday', 'Wednesday', 'Friday' );
|Send feedback about this page via email or DocCommentXchange||Copyright © 2008, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.0|