Jump to content

Archived

This topic is now archived and is closed to further replies.

aashish

GUYS SOLVE THIS IF U CAN!

Recommended Posts

[b]i want to access a Table , pick those values and dump into another table values,
then again when sending the value and dumping it over again, in the process , it needs to delete the existing values

Assume u have 2 tables A n B

the contents of table A need to be dumped to B
then when u do the process the second time from A, the contents in B need to be deleted

thanks to al of u inadvance!

please rememeber it is an update sort of transaction..

crack this if u can..[/b]

Share this post


Link to post
Share on other sites
sounds like you're basically running a backup script of one table. if this is the case, you really could just do an INSERT from SELECT. i'll try to illustrate it here:

[!--sql--][div class=\'sqltop\']SQL[/div][div class=\'sqlmain\'][!--sql1--]/* first, clean out the backup table */
TRUNCATE TABLE backupTable;

/* now, [span style=\'color:blue;font-weight:bold\']insert[/span] all the records */
[span style=\'color:blue;font-weight:bold\']INSERT[/span] [color=green]INTO[/color] [color=orange]backupTable[/color] (field1, field2, field3)
[span style=\'color:blue;font-weight:bold\']SELECT[/span] a.field1, a.field2, a.field3 [color=green]FROM[/color] [color=orange]origTable[/color] a;
[!--sql2--][/div][!--sql3--]

hope this helps

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.