Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Inserstatement

RE: Inserstatement

From: Nicoll, Iain (Calanais) <iain.nicoll_at_calanais.com>
Date: Tue, 27 Nov 2001 06:31:10 -0800
Message-ID: <F001.003CD916.20011127053523@fatcity.com>

I hate to disagree but why couldn't you

update x
set field = (select field1

             from p
             where p.join_field = x.join_field)
where conditions

Iain Nicoll

-----Original Message-----
Sent: Tuesday, November 27, 2001 12:45 PM To: Multiple recipients of list ORACLE-L

You cannot achieve this by one sql statement. Instead you should consider use PL/SQL.
Make your own procedure or an anonymous PL/SQL block. I would like to give you an example but you have to tell more about your problem, like the update should be done based on a relation between those 2 tables... and furthermore it's an insert or an update what you were talking about?
If you want just an insert you can use something like: INSERT INTO X
  (<field_in_X>)
  SELECT <field_in_P> FROM P

Regards
Iulian

-----Original Message-----
Sent: Tuesday, November 27, 2001 1:45 PM To: Multiple recipients of list ORACLE-L



This email has been tested for viruses by F-Secure Antivirus administered by IT Network Department.

How can I update one field in table X
from another table, table P. Table P have 5 different fields but only one of them should be used to update table X.
Give me an example on a sql statement for this.

Sincerely

Roland S

--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author:
  INET: Roland.Skoldblom_at_ica.se

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).

**
The information contained in this communication is confidential and may be legally privileged. It is intended solely for the use of the individual or entity to whom it is addressed and others authorised to receive it. If you are not the intended recipient you are hereby notified that any disclosure, copying, distribution or taking action in reliance of the contents of this information is strictly prohibited and may be unlawful. Mobil Rom is neither liable for the proper, complete transmission of the information contained in this communication nor any delay in its receipt.

**

--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author:
  INET: Iulian.ILIES_at_mobil-rom.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author: Nicoll, Iain (Calanais)
  INET: iain.nicoll_at_calanais.com
Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Tue Nov 27 2001 - 08:31:10 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US