Home » SQL & PL/SQL » SQL & PL/SQL » Multiple Insert, Internal Query and Static Value
Multiple Insert, Internal Query and Static Value [message #244432] Tue, 12 June 2007 15:08 Go to next message
hdogg
Messages: 93
Registered: March 2007
Member
I am doing an insert statement, copying one table to another while adding a "ARCHIVE ID"

INSERT INTO Employee_ARCHIVE(First_Name,Last_Name, ARCHIVEID)
SELECT First_Name, Last_Name FROM EMPLOYEES , $archiveid????


Archive ID is a static number, that is the same for the whole batch


So the question is, how can do i select and copy some values from another table, while also inserting some static values?

[Updated on: Tue, 12 June 2007 15:14] by Moderator

Report message to a moderator

Re: Multiple Insert, Internal Query and Static Value [message #244434 is a reply to message #244432] Tue, 12 June 2007 15:15 Go to previous messageGo to next message
Michel Cadot
Messages: 64132
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
INSERT INTO Employee_ARCHIVE (First_Name,Last_Name, ARCHIVEID)
SELECT First_Name, Last_Name, $archiveid FROM EMPLOYEES
/

Regards
Michel
Re: Multiple Insert, Internal Query and Static Value [message #244435 is a reply to message #244434] Tue, 12 June 2007 15:22 Go to previous message
hdogg
Messages: 93
Registered: March 2007
Member
Thanks Michel!

Kindest Regards,

Hyrum
Previous Topic: Hierarchical SQL problem
Next Topic: TRUNC(SYSDATE,'mm')-1 and appending a time
Goto Forum:
  


Current Time: Thu Dec 08 02:05:53 CST 2016

Total time taken to generate the page: 0.05003 seconds