RE: Trucate Command
From: Vishal Parkar (REMOVE_THIS_vgparkar_at_yahoo.co.in)
Date: 05/07/04
- Next message: Hari: "Re: Trucate Command"
- Previous message: Garry Dawkins: "Trucate Command"
- In reply to: Garry Dawkins: "Trucate Command"
- Next in thread: Hari: "Re: Trucate Command"
- Reply: Hari: "Re: Trucate Command"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 6 May 2004 19:41:03 -0700
hi garry,
>>Can I use the truncate command???
No, Truncate table command removes all rows from a table.
>>Can I use it to bring the temp_table data back to the original table
with out reprocusions? <<
No, you can not do any kind of recovery using truncate table command. use "truncate table" command to remove all the rows from the table.
What you need is INSERT INTO....SELECT statement. By which you can transfer the rows from both the tables.
The SELECT query in the INSERT statement can be used to add values into a table from one or more other tables.
A typical select... into syntax will look as follows.
1)
INSERT INTO destination_table(col1,col2)
SELECT col1,col2
FROM <source_table>
WHERE .....
2)
once you transfer the rows to the temp table. you can delete the rows from original table using
DELETE FROM table where..... syntax.
3)
To transfer rows back to the original table from temp table you can use same INSERT INTO....SELECT syntax.
-- Vishal Parkar vgparkar@yahoo.co.in | vgparkar@hotmail.com
- Next message: Hari: "Re: Trucate Command"
- Previous message: Garry Dawkins: "Trucate Command"
- In reply to: Garry Dawkins: "Trucate Command"
- Next in thread: Hari: "Re: Trucate Command"
- Reply: Hari: "Re: Trucate Command"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|