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: 64718
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: Mon Apr 24 20:11:50 CDT 2017

Total time taken to generate the page: 0.07558 seconds