A table, A has listed A: primary key, VARCHAR2 (10), b: VARCHAR2 (50), and c: VARCHAR2 (50), d: VARCHAR2 (50); To the table to import Execl table data article 5, article 3 b column data, q: use Oracle triggers, let the b column not repeat, repeat data have the same time, in the back automatically add 1, 2, 3,..., for example: b: 4, 123123111123122 after the trigger to: 123-1123-4, 2111123-3122, several duplicate data, behind the "-" is automatically added to the few
CodePudding user response:
if inserting then Select count (*) into the I from table_a where A substr (a., 0, length: new. B))=: new. B; If I=0 then Insert into... The value... The else i=i+1; B: new. B:=: new. | | '-' | | I; Insert into... The value... end if;
CodePudding user response:
"Insert into... The value... "This write an additional statement? Insert into A (b, c, d) values (', ', ')?