CREATE PROCEDURE fire_emp (enum NUMBER) AS
BEGIN
DELETE FROM jward.emp@hq.acme.com
WHERE empno = enum;
END;
When a user or application calls the FIRE_EMP procedure, it is not apparent that a remote table is being modified.
A second layer of location transparency is possible if the statements in a procedure indirectly reference remote data using local procedures, views, or synonyms. For example, the following statement defines a local synonym:
CREATE SYNONYM emp FOR jward.emp@hq.acme.com;
Consequently, the FIRE_EMP procedure can be defined with the following statement:
CREATE PROCEDURE fire_emp (enum NUMBER) AS
BEGIN
DELETE FROM emp WHERE empno = enum;
END;
If the table JWARD.EMP@HQ is renamed or moved, only the local synonym that references the table needs to be modified. None of the procedures and applications that call the procedure require modification.