Support Topics Documentation Slack YouTube Blog

How to write stored procedure to insert data from one table to another?

(ramesh bs) #1

How to insert data from one table to another table?. Lets take i have table A & table B.
A table has column ID, Name, title, Age, Description. B table has column called ID, Name.
If i insert data to table A column Name, the Name field should get automatically insert to Table B. How to achieve?

(Mark Piller) #2
  1. use API to load data from table A

  2. use API to write data to table B

(Vitaly Vengrov) #3


It’s called Custom Business Logic.
You need to write a custom event handler for the afterCreate event.

Backendless.ServerCode.Persistence.afterCreate('TableA', function(req, res) {
    return Backendless.Data.of('TableB').save({ name: });
}, true);

(ramesh bs) #4

Thank you, i will check and let you know. Thanks for the support