To modify a macro, use the REPLACE MACRO statement.
For example, the following statement changes the default department number in the NewEmp macro from 100 to 300.
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
;
)
;