If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Oracle > Update From ....

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-31-03, 13:15
austrian_ead austrian_ead is offline
Registered User
 
Join Date: Jan 2003
Posts: 14
Update From ....

Hi Folks,

this time my question is easy for professionals (i hope so).

I want to update a field of a table. In SQL-Server, i would have done as following:

UPDATE taskdata t SET t.start_plan = c.start_plan
FROM view_test c
WHERE t.caseid = c.callid

This Command does the following: When t.caseid and c.callid have the same value, the value of t.start_plan is updated by c.start_plan.

Please help me, what is the right Syntax for this in Oracle.
Reply With Quote
  #2 (permalink)  
Old 01-31-03, 16:55
marist89 marist89 is offline
Registered User
 
Join Date: Oct 2002
Location: greenwich.ct.us
Posts: 279
Code:
SQL> select * from xyz;

        ID TXT_DATA
---------- --------------------
         1
         2
         3
         4
         5
         6
         7
         8
         9
        10

10 rows selected.

SQL> select * from xyz_update_from;

         X TXT_UPDATE
---------- --------------------
         1  000000000001
         3  000000000003
         5  000000000005
         7  000000000007
         9  000000000009

SQL> update xyz x
  2     set txt_data = (select txt_update from xyz_update_from u where u.x = x.id)
  3* where x.id in (select x from xyz_update_from)
SQL> /

5 rows updated.

SQL> commit;

Commit complete.

SQL> select * from xyz;

        ID TXT_DATA
---------- --------------------
         1  000000000001
         2
         3  000000000003
         4
         5  000000000005
         6
         7  000000000007
         8
         9  000000000009
        10

10 rows selected.
__________________
Jeff Hunter
http://marist89.*************
Reply With Quote
  #3 (permalink)  
Old 01-31-03, 17:04
austrian_ead austrian_ead is offline
Registered User
 
Join Date: Jan 2003
Posts: 14
Talking

Perfect, that's what I needed. Thanks a lot :-)
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On