Update warn change

Asked

Viewed 159 times

1

You can tell if a value has been changed in a direct table in the application?

Like I gave a

UPDATE tabela SET valor = 1 WHERE id = 2;

And in the application appear the message:

O Valor foi alterado para 1

What I would like to do is to inform the client when there is a new system update on the internal network.

I do this, when the System restarts, it automatically updates when the version is different from the current one, but I would like to do this in real time, like, at the time I changed the version in the database appear on the machines that there is new version available.

I thought I’d create a Procedure, but I have no idea where I can do that.

My System is in Java

  • I believe asynchronous connections are capable of solving your problem. Aka: Ajax

  • Directly through the database? I think it has to be through the application. The server send a notification to connected clients, it is possible to do this with Websockets.

  • You could make a module the part that is running in the background and checking the version, if there is change it sends alert to the user.

  • 1

    forgot to say that the system is in java

  • Yeah, that’s what I wanna do

  • I think it would be like a Firebase Thinker

Show 1 more comment

1 answer

0

You can use a Trigger After Update.

In it you can recover the old value and the value through the syntax :OLD and :NEW.

With this Rigger you can do whatever you want: insert data into some other table, update some data, etc.


Here has a reference of how to make a Trigger run a Java code.

  • they tell to create a class in the oracle itself and in the application?

Browser other questions tagged

You are not signed in. Login or sign up in order to post.