I'm doing a trigger in sql which concatenates a word with a number, so this is:
create or replace trigger TG_curso_Auto before insert on cursos for each row declare var int; begin select count(*)+1 into var from cursos; :new.siglas := concat(:new.siglas,'-',var); end; /
Here var is an integer variable that I need to concatenate with a string, but I do not know how to pass it to string, the courses table simply has an id and an acronym
create table cursos id number(7) not null, siglas varchar(4) not null);
To better explain the var start from 1 and as you add something goes adding 1 to 1 ... when trying to insert into the table courses for example (
insert into cursos values (12345,'Bases') ) should put in the column acronyms Bases-1 then something like acronyms-2 , < em> acronyms-3 ...
Any ideas on how to solve this problem or is it not possible to do this?