Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Whats wrong with my trigger in sql? create or replace trigger increment_id before insert on customer for each row Begin select max(id)+1 into :new.id from
Whats wrong with my trigger in sql?
create or replace trigger increment_id before insert on customer for each row Begin select max(id)+1 into :new.id from customer; EXCEPTION insert values (1) into ID from customer; End ;
the code without the exception works but i think there is a big mistake with my exception handling
what i want is that if there is no ID in the table, then just put it as number 1 automatic
i know my mistake is probably so bad but im just starting to learn sql im sorry
thank u everyone
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started