473,387 Members | 1,590 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

updating using SubQuery Problen

Below given Query using for updating a table
it gives error = ORA - 00933 SQL command not properly ended.
if below given query is incorrect , than kindly help to correct it.


update normalised_event_error
set c_party_internal_id=(
select distinct service_id,service_name from service_history sh,normalised_event_error nee
where sh.service_name=nee.c_party_id
and nee.c_party_internal_id is null
and trunc(nee.charge_start_date) > sysdate -35
and nee.error_message_id=2563
and SERVICE_STATUS_CODE=3
) d
where d.service_name=c_party_id
and SERVICE_STATUS_CODE=3
and sysdate between effective_start_date and effective_end_date
Aug 30 '08 #1
2 1731
amitpatel66
2,367 Expert 2GB
Your sub query select 2 columns and it is NOT POSSIBLE to update one column with 2 values.

Your UPDATE query is incorrect and you need to change to sleect only one column in the subquery that you want to update with. Make these changes and post back in case of any issues
Nov 6 '08 #2
Pilgrim333
127 100+
Furthermore, you give an alias to the sub query you use to update the values and you use that in your where clause. I don't think that will work either.

Pilgrim.
Nov 6 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: ChrisL | last post by:
I am trying to update text fields where the field only has the value "closed." So a field that has closed and anything else will not be updated. update dbo.Hist set dbo.Hist.Notes = '' FROM ...
5
by: erikthenomad | last post by:
Hey...newbie question: I've got three columns in my database, the third of which is blank right now, and I need it to equal the value of column one minus column two. While I can accomplish this...
7
by: Dimitri Furman | last post by:
What would be the correct syntax, if any, that allows updating a table variable in a statement that uses the same table variable in a correlated subquery? Here's an example: DECLARE @t table (N1...
1
by: mlrehberg | last post by:
Hi, New to writing sql script I get this error in my sql script Server: Msg 512, Level 16, State 1, Line 1 Subquery returned more than 1 value. This is not permitted when the subquery...
6
by: J Smith | last post by:
After doing some googling through the lists and such, I wasn't able to arrive at a solution for a problem I've run into recently. I've seen mention of similar symptoms, but my case seems different....
6
by: recif20002002 | last post by:
Hello I am trying to update table1 and set a new value with a condition selecting only the results for the element with the specified ID and the first one with the Date field null. The query...
3
by: jcf378 | last post by:
Hi all-- Does anyone have any insight as to how I might create a search form that allows a user to select criteria based on any related table in the whole database. The search form I have now only...
1
by: jcf378 | last post by:
Hi all-- Does anyone have any insight as to how I might create a search form that allows a user to select criteria based on any related table in the whole database. The search form I have now only...
3
by: prigupta2 | last post by:
Private Sub EnlargeDrawing(ByVal DrawControl As System.Drawing.Graphics) DrawControl.Height = VB6.TwipsToPixelsY(4980) DrawControl.Width = VB6.TwipsToPixelsX(4980) Error 1 'Height' is not a member...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.