Click here to Skip to main content
16,019,740 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have 2 tables in oracle database.
First table is Names and it has Columns A,B,C
Second table is NamesHistory which has columns AH,BH,CH,HistoyDate

I want to move record from table names to NamesHistory.Data from column A will go in column AH,from B to BH so on.
I want to use column HistoyDate, to trace at which date this record was moved to history table.
initially when HistoyDatecolumn was not added i used query

INSERT INTO NamesHistory (AH,BH,CH) SELECT A,B,C FROM Names;
Now in column NamesHistory i want to insert SYSDATE.

Can someone tell me how to do so?
Posted

1 solution

hi ,
please do update your table , after adding the column HistoryDateColumn into your NamesHistory.


the entire column will have null values.

Then simple run one update statement like

update NamesHistory set HistoryDate = sysdate
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900