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: fetch out of sequence

RE: fetch out of sequence

From: Igor Neyman <ineyman_at_perceptron.com>
Date: Mon, 23 Aug 2004 13:45:17 -0400
Message-ID: <004201c48938$f3d14a90$0704a8c0@development.perceptron.com>


Yes, you can, as long as emp_id and person_id are "keyed" columns in their respective tables.

Igor Neyman, OCP DBA
ineyman_at_perceptron.com

-----Original Message-----
From: oracle-l-bounce_at_freelists.org
[mailto:oracle-l-bounce_at_freelists.org] On Behalf Of Gogala, Mladen Sent: Monday, August 23, 2004 12:35 PM
To: 'oracle-l_at_freelists.org'
Subject: RE: fetch out of sequence

Completely incorrect syntax. You cannot update a column
>From one table with a column from another just like that.
Rewrite that as a short PL/SQL script, and everything will Be fine. Nice try, but no cigar.

--
Mladen Gogala
A & E TV Network
Ext. 1216


-----Original Message-----
From: Paula_Stankus_at_doh.state.fl.us
[mailto:Paula_Stankus_at_doh.state.fl.us] 
Sent: Monday, August 23, 2004 1:31 PM
To: Paula_Stankus_at_doh.state.fl.us; oracle-l_at_freelists.org
Subject: RE: fetch out of sequence


Rewriting into an update - I am testing a multiple column - join update:

  1  update
  2  (select a.last_name, b.last_name
  3     from emp a, person b
  4      where a.emp_id =3D b.person_id)
  5* set a.last_name =3D b.last_name
SQL> desc person;
 Name                                      Null?    Type
 ----------------------------------------- -------- =
----------------------------
 PERSON_ID                                          NUMBER
 LAST_NAME                                          VARCHAR2(50)
 FIRST_NAME                                         VARCHAR2(50)
 LOADDATE                                           DATE

SQL> desc emp;
 Name                                      Null?    Type
 ----------------------------------------- -------- =
----------------------------
 EMP_ID                                             NUMBER(38)
 LAST_NAME                                          VARCHAR2(50)
 FIRST_NAME                                         VARCHAR2(50)
 LOADDATE                                           DATE


When I execute the above update, I get the error:

set a.last_name =3D b.last_name
                  *
ERROR at line 5:
ORA-00904: "B"."LAST_NAME": invalid identifier

----------------------------------------------------------------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
----------------------------------------------------------------
To unsubscribe send email to:  oracle-l-request_at_freelists.org
put 'unsubscribe' in the subject line.
--
Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------


----------------------------------------------------------------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
----------------------------------------------------------------
To unsubscribe send email to:  oracle-l-request_at_freelists.org
put 'unsubscribe' in the subject line.
--
Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------
Received on Mon Aug 23 2004 - 12:41:18 CDT

Original text of this message

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