On Tuesday, January 17, 2017 at 6:44:01 AM UTC-8, Sankhajit Das wrote: > > hey. I have created a mysql database in my web2py app. >> > now i want to create another sqlite database such that whatever data i > enter > in sqlite database. it automatically gets copied in mysql database. > Pls somebody help me do ds with full code. > >
To do it with web2py, you open a connection to both databases, select from one and add to the other. See <URL: http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Inserting-and-updating-from-a-dictionary> If the data is coming from a form, you can trigger the copy by using an after-insert callback. <URL:http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#callbacks-on-record-insert--delete-and-update> If you don't need to do the copying ASAP, but prefer to batch the job, then the scheduler and export as CSV might be more convenient. <URL:http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#CSV--one-Table-at-a-time-> <URL:http://web2py.com/books/default/chapter/29/04/the-core#web2py-Scheduler> Good luck! /dps -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.

