Jump to content

GUYS SOLVE THIS IF U CAN!


aashish

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]
Link to comment
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
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.