Candeias Posted May 28, 2009 at 09:46 PM Report #268143 Posted May 28, 2009 at 09:46 PM Boas, estou a tentar fazer um trigger utilizando o After Insert, em que o objectivo é o seguinte: Tabelas: Tabela1 ID_1 int not null, ValorA int not null, Tabela2 ID_2 int not null, ID_1 int not null, Campo1 int not null. um dos registos da tabela1 é: ID_1 ValorA ------------------- 1 10109 na tabela2 vai ser introduzo valores mas o ID vem sempre com o valor 0: ID_2 ID_1 Campo1 ---------------------------- 0 1 555 Preciso de criar um trigger que depois de ser inserido um registo qualquer na tabela2 o id seja alterado de 0 para o valor 10109555, ou seja, atraves da relação vams buscar o ValorA da tabela1 e concatenamos com o Campo1 da tabela2.... Alguem pode dar uma ajuda??? Obrigado!
Betovsky Posted May 29, 2009 at 07:15 PM Report #268424 Posted May 29, 2009 at 07:15 PM http://www.techonthenet.com/oracle/triggers/index.php "Give a man a fish and he will eat for a day; Teach a man to fish and he will eat for a lifetime. The moral? READ THE MANUAL !" Sign on a computer system consultant's desk
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now