Timeline for How to insert multiple tables into their respective backup tables using insert sql?
Current License: CC BY-SA 3.0
8 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jun 15, 2020 at 9:13 | history | edited | CommunityBot |
Commonmark migration
|
|
Apr 4, 2016 at 22:30 | comment | added | No Sssweat |
@RajenderRajan you can't use ON DUPLICATE KEY UPDATE alone, if you want alone use UPDATE instead.
|
|
Apr 4, 2016 at 9:48 | comment | added | Clive♦ |
Drupal's API won't help you with a query that complicated, you'll need to come up with the raw SQL and just run that through db_query .
|
|
Apr 4, 2016 at 9:27 | comment | added | Rajender Rajan | Can I use "ON DUPLICATE KEY UPDATE" alone ? As i am using single query to insert multiple tables so i can't use any condition for it. | |
Apr 4, 2016 at 8:35 | comment | added | No Sssweat |
actually, in this case you should use ON DUPLICATE KEY UPDATE . For example: see my answer here stackoverflow.com/questions/36144788/join-a-specific-table-row. All you have to do is add the last line with the values of your $backup_tbl_name
|
|
Apr 4, 2016 at 8:15 | comment | added | Rajender Rajan | I am using single query as: db_query("INSERT INTO $backup_tbl_name SELECT * FROM $tbl"); , to insert respective backup tables and each backup table has its own schema similar to its parent table. Now how to use merge query to all such tables ? | |
Apr 4, 2016 at 8:09 | history | edited | No Sssweat | CC BY-SA 3.0 |
added 106 characters in body
|
Apr 4, 2016 at 7:58 | history | answered | No Sssweat | CC BY-SA 3.0 |