insert into help

From: Walt Bigelow <walt(at)stimpy(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: insert into help
Date: 1999-01-21 12:46:19
Message-ID: Pine.LNX.3.96.990121123652.14961B-100000@alice.stimpy.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)stimpy(dot)com

Browse pgsql-sql by date

  From Date Subject
Next Message Tim Perdue, The Des Moines City.net 1999-01-21 12:47:39 Re: [SQL] Max Length of SQL
Previous Message Tim Perdue, The Des Moines City.net 1999-01-21 06:20:04 Max Length of SQL