Oracle
1Z0-882 · Question #53
You wish to create a trigger on the city' table that will check the value of the District' field before any INSERT. The trigger needs to change it to" Unknown" for an empty string or NULL. CREATE…
The correct answer is D. No; the OLD keyword cannot be used in an INSERT trigger. See the full explanation below for the reasoning.
Question
You wish to create a trigger on the city' table that will check the value of the District' field before any INSERT. The trigger needs to change it to" Unknown" for an empty string or NULL. CREATE TRIGGER City_bi BEFORE INSERT ON CITY FOR EACH ROW BEGIN IF OLD. District IS NULL OR OLD.District= . . THEN SET NEW.District='Unknown'; END IF :
END; Does the CREATE TRIGGER statement accomplish this goal?
Options
- AYes; the trigger works correctly.
- BNo; FOR EACH ROW is invalid syntax.
- CNo; the syntax should be CREATE TRIGGER city-bi ON city BEFORE INSERT....
- DNo; the OLD keyword cannot be used in an INSERT trigger.
How the community answered
(27 responses)- A4% (1)
- B7% (2)
- C15% (4)
- D74% (20)
Community Discussion
No community discussion yet for this question.