Identify differences between local and global procedures

Completed

When you create a procedure in your object, the procedure is global by default, meaning that other objects can access this procedure. If other extensions depend on your extension, they access procedures that are public.

procedure MyFunction()
begin
   // Logic goes here
end;

Alternatively, you can make your procedure local, internal, or protected. When a procedure is local, you can only access it from within the same object. To create a local procedure, you must specify the local keyword.

local procedure MyFunction()
begin
   // Logic goes here
end;

When a procedure is internal, you can only access it from within the same extension. Therefore, other objects in the same extension can access this procedure. To create an internal procedure, you must specify the internal keyword.

internal procedure MyFunction()
begin
   // Logic goes here
end;

When a procedure is protected, you can only access it from within the defining object and host object. Thus, if you create a procedure within a table, then table extensions that extend your table can access this procedure. To create a protected procedure, you must specify the protected keyword.

protected procedure MyFunction()
begin
   // Logic goes here
end;