insert into help - Mailing list pgsql-sql

From Walt Bigelow
Subject insert into help
Date
Msg-id Pine.LNX.3.96.990121123652.14961B-100000@alice.stimpy.com
Whole thread Raw
List pgsql-sql
I have to impliment a loging facility (a table) into my database system.
As it is now, I do a 3 stage operation within access to get this done.

select the current disposition and location from our medialibrary,
update the table,
insert into the log table olddispo, oldlocal, newdispo, newlocal, etc

My question is this:
I'd like to remove one step (selecting the current info) and do the log
first:

something like

INSERT INTO tblmediastatuschangelog (librarynumber, olddispo, oldlocal,
newdispo, newlocal, date) VALUES ('1123',...

that is where I get stuck.  I used INSERT INTO before like:
INSERT INTO tbladdressnew SELECT * from tbladdressold;

How might I be able to compound the insert into statment so that I can
provide values and also have it obtain olddispo, and oldlocal from the
media table?

Can this be done with SQL?

Thanks for any help!!!!

Walt
walt@stimpy.com


pgsql-sql by date:

Previous
From: Tim Perdue
Date:
Subject: Java/JDBC/PGSQL Mailing List Archiver
Next
From: Gregory Holston
Date:
Subject: Changing a type