The following example shows how to modify a macro. Suppose you want to change the NewEmp macro so that the default department number is 300 instead of 100. The REPLACE MACRO statement looks like this:
REPLACE MACRO NewEmp (name VARCHAR(12),
number INTEGER NOT NULL,
dept INTEGER DEFAULT 300)
AS (INSERT INTO Employee (Name,
EmpNo,
DeptNo)
VALUES (name,
number,
dept)
;
UPDATE Department
SET EmpCount=EmpCount+1
WHERE DeptNo=dept
;
)
;