Click here to Skip to main content
15,113,873 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
<br />
SQL> desc t1<br />
 Name         Null?    Type<br />
 -------------------------------<br />
 NO          NOT NULL NUMBER(38)<br />
 TID                  NUMBER(38)<br />
<br />
SQL> desc t2<br />
 Name          Null?    Type<br />
 ----------------------------------<br />
 TID           NOT NULL NUMBER(38)<br />
 NM                     CHAR(10)<br />
 NUM                    NUMBER(38)<br />
<br />
SQL> update t1,t2                         <br />
  2  SET t2.num=220333<br />
  3  where t1.tid=t2.tid<br />
  4  and<br />
  5  ;<br />

update t1,t2
ERROR at line 1:
ORA-00971: missing SET keyword

I want to update <num> column of t2 but using <no> column of table t1.
Updated 12-Feb-13 23:46pm

1 solution

SET     t2.num = 220333
    SELECT  1
    FROM    t1
    WHERE   t1.tid=t2.tid
surkhi 14-Feb-13 0:37am
Thanx for it...
So,I have to select the row number to which I want to modify in select statement(select 1,select 2,select3........)
Jörgen Andersson 14-Feb-13 2:18am
No, the constant is only so that a row gets selected for the EXISTS clause. For an EXISTS to work you can select anything.
I prefer to select a constant instead of the standard * because I've been told it uses less memory. I have never controlled that statement though. Have checked it now, it doesn't matter, you can select whatever you want.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900