Skip to main content
Known Participant
August 1, 2011
Question

update stock levels on insert

  • August 1, 2011
  • 1 reply
  • 671 views

hi all,

i have an insert record using dreamweaver which inserts parts used into a table in the database.

at the same time of the insert i would like to trigger an update record in the stock table which will automatically reduce the quantity of that stock level by the quantity entered in the insert record form.  could you help.

the other part of this is that the stock level has 2 elements to it which is unit stock and van stock so it would need to update based on the insert record form drop down box which will be "Unit" or "Van" options then deduct from there?

appreciate any help.

cheers

This topic has been closed for replies.

1 reply

Participating Frequently
August 1, 2011

Use a stored procedure for linked transactions like this.

deansy55Author
Known Participant
August 1, 2011

like what?

no example shown.

thanks

Participating Frequently
August 1, 2011

>no example shown.

Sorry, I am not going to type in example code for a stored procedure, and you did not mention what DBMS you are using. Basically, if you know how to write a stored procedure, it will be simple. If you don't, then consult the reference manual for your DBMS, as syntax varies between all of them.