CREATE OR REPLACE TRIGGER P88
AFTER INSERT ON reparation
FOR EACH ROW
DECLARE
vope number;
BEGIN
SELECT observation_reparation into vope from repartion;
if(vope IS NULL)THEN
EXECUTE IMMEDIATE 'ALTER TABLE ' || reparation.observations_Reparation || ' MODIFY libelle_piece NVARCHAR2(50)';
END IF;
END;
/
我明白了:
错误:表或视图不存在。
答案 0 :(得分:-1)
CREATE OR REPLACE TRIGGER P88
AFTER INSERT ON reparation
FOR EACH ROW
DECLARE
vope number;
BEGIN
SELECT observation_reparation into vope from repartion;
if(vope IS NULL)THEN
EXECUTE IMMEDIATE 'ALTER TABLE reparation RENAME COLUMN observations_Reparation TO libelle_piece';
END IF;
END;
如果您还需要更改列的声明,则需要另一个ALTER语句
alter table reparation modify (libelle_piece NVARCHAR2(50))