Forums Register Login

how to maintain a table field's value from second table'value

+Pie Number of slices to send: Send
Hi,
I am working on a project and I want to substract quantity from a table using that field in second table.
e.g. I am using material_quantity in one table is 33 and I enter 30 in second table then first table's quantity should be reduce and update with 3

How it is possible with (java coding).

Thanks in advanced...
+Pie Number of slices to send: Send
Go with Triggers, this makes your difficult job easier.
+Pie Number of slices to send: Send
Nasty data modelling. Are you stuck with this? If not, I would review it. You are making your life harder than it needs to be.

If you can't, triggers, as Muhammad suggests, are the way to go. Java code is not the place to do it because you are making your data model rely on one specific database client.
Every plan is a little cooler if you have a blimp. And a tiny ad.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 927 times.
Similar Threads
how to insert multiple value in database
Calculating
Sum function sql statement
JavaScript in Servlets
how to update data of a field in one table from other table using jsp or java?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 23:51:07.