Dúvidas, dicas e truques de PL/SQL. Aqui também vão assuntos relacionados a pacotes, triggers, funções, Java-Stored Procedures, etc

Poston Mon, 12 Jun 2006 11:56 am

Hello guys, I have a problem with a Trigger.

I have a table that is responsible for stock movements and any action (insert, delete or update) that is made in this table triggers the Trigger that updates another table responsávels by stock estimate calculations.

The problem is as follows, I discovered a hole in that program that is running at times and need to correct, just that the only way to fix this error, is to make a query on the table that the trigger dipara, in case the movements, to find out the MAX date of entry and withdrawal movement and update the table of estimateHowever, she returns an error because the table is mutating.

I tried to create a view but also does not.

I tried to use autônuma transaction with PRAGMA AUTONOMOUS_TRANSACTION; and nothing, because it's not made any changes to give a commit or roll back, and so the query doesn't return anything.

Does anyone have any suggestions?

Thank you!
Location: Videira - SC

Poston Tue, 04 Jul 2006 12:34 pm

Brother, try to create another table with CREATE TABLE_TEMP AS SELECT * FROM TABELA_ORIGEM, and then do the selects that you need.

Location: Niterói - RJ

Gustavo Erthal Jr. | TRISCAL
Rio de Janeiro | (21) 2507-2010
São Paulo | (11) 3167-0526

Poston Tue, 04 Jul 2006 11:54 pm

Good night, you could put a JOB run of minute minute, making queries in your motion table and inserting/updating the necessary.
If you think that is too big/lengthy consultation, you can put a date field, and see only the records that have date greater than or equal to the last time the JOB was shot
Location: Toledo - PR

Return to PL/SQL

Who is online

Users browsing this forum: No registered users and 7 guests