Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Database > Oracle
|
Oracle General Oracle database discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Oracle section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 12th, 2006, 04:07 AM
Registered User
 
Join Date: Jun 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problem with query

Iam trying to update db using the following query.
Am getting error while executing the same.

UPDATE A
SET LAST_NAME = 'SUJAY'
FROM TABLE1 A, TABLE2 B, TABLE3 C
WHERE A.CH_ID = B.C_ID
AND B.S_S_ID = C.S_ID
AND C.S_ID = '483075'

Can some one help me in finding wots problem with this query.

Thanks in advance

 
Old June 27th, 2006, 06:05 AM
Registered User
 
Join Date: Jun 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to calvinthebrat Send a message via Yahoo to calvinthebrat
Default

What is the error you are receiving ? Can you paste the error in your reply ?


Thanks and Regards,
Ramanan
 
Old June 27th, 2006, 07:25 AM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to vinod_yadav1919 Send a message via Yahoo to vinod_yadav1919
Default

Hii sri_smilesb4u !!
You can't use alias name while updating the records in main outer query .

try to change like :)
>>

update TABLE1
set TABLE1.LAST_NAME='Sujay'
 from
(SELECT TABLE2.C_ID
  FROM TABLE2
 INNER JOIN
   TABLE3 ON TABLE2.S_S_ID=TABLE3.S_ID
 WHERE TABLE3.S_ID ='483075'
)as A
where TABLE1.CH_ID=A.C_ID

Hope this will help you; nice id u have


Cheers :)

vinod





Similar Threads
Thread Thread Starter Forum Replies Last Post
Query Problem. rupen Access 3 April 27th, 2007 07:43 AM
Query Problem bundersuk VB Databases Basics 0 December 30th, 2006 07:50 AM
problem with query harpua Classic ASP Databases 1 January 24th, 2005 12:36 PM
Problem in query leo_vinay Classic ASP Databases 5 January 21st, 2005 06:32 AM
query problem mateenmohd SQL Server 2000 7 September 9th, 2003 11:58 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.