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

Home -> Community -> Usenet -> c.d.o.misc -> Re: update from another table row by row

Re: update from another table row by row

From: Brian W. Chester <bwchester_at_home.com>
Date: Mon, 08 Nov 1999 16:23:08 GMT
Message-ID: <MNCV3.1070$Zu4.23941@news1.rdc1.mb.home.com>


David,

This looks like a homework assignment. Forgive if it is not. Anyway, I am very confused as to what you are trying to do. If this is not a homework assignment please provide some example data and an understanding as to why you want to create a table with the data column from table2 entered into the table twice? I must admit, looking at your SQL is very confusing.

Brian

David Zlotchenko 1 wrote in message <7vv028$5c7$1_at_penn.dii.utk.edu>...
>I have table t1:
>id char(8) primary key,
>status varchar2(100),
>name varchar2(200)
>);
> and table t2:
>id char(8),
>category varchar2(10),
>data varchar2(200)
>);
>
>Table t2 contains data for fields status and name in the table t1.
>
>I can view my data like this:
>select A.id,A.data,B.data from
> (select C.id,D.data from t1 "C", t2 "D"
> where D.id=D.id and D.category='status') "A",
> (select data from t1 "E", t2 "F"
> where E.id=F.id and F.category='approver') "B"
>;
>
>How do I put the image of the above dynamic table into the table t1?
>
>When I try to put it into update clause, it gives me an error
>ORA-01427: single-row subquery returns more than one row.
>
>Do I have to use cursor only? Can I use a view to
>update multiple rows
>conditionally?
>
>Thanks for your help. DAvid.
>
>--
>--
>David Zlotchenko
>E-mail: zlotchen_at_cs.utk.edu
>WWW: http://www.oars.utk.edu/~zlotchen
Received on Mon Nov 08 1999 - 10:23:08 CST

Original text of this message

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