RE: UPDATE STATEMENT QUESTION

RE: UPDATE STATEMENT QUESTION

 

  

Naw, I don't think so. I have a very similar UPDATE statement I run all the time without that additional WHERE clause.

Jack


-----Original Message-----
From: Gombosi Andras [mailto:oracledba-ezmlmshield-x47081136.[Email address protected]
Sent: Wednesday, April 30, 2008 11:25 AM
To: LazyDBA Discussion
Subject: RE: UPDATE STATEMENT QUESTION

In addition you do not have a WHERE clause in your main update query, so it the inner select returns a row, all of the records in your pop_lines table will be updated. I guess it is not your goal.

rgrds
_______________________________________________________
Andras Gombosi
Software Engineer
Andras.[Email address protected]
Irish Life Investment Managers, Loc. B42
Beresford Court,Beresford Place,D1
353-1-7042836

-----Original Message-----
From: Michael Peel [mailto:oracledba-ezmlmshield-x46751676.[Email address protected]
Sent: 30 April 2008 16:21
To: LazyDBA Discussion
Subject: RE: UPDATE STATEMENT QUESTION

Just a little to add. You need your query to return just one row. Any more
than that and you'll se a too many rows error.

Michael Peel


-----Original Message-----
From: Barron s Webmaster
[mailto:oracledba-ezmlmshield-x41157388.[Email address protected]
Sent: 30 April 2008 16:08
To: LazyDBA Discussion
Subject: RE: UPDATE STATEMENT QUESTION

Jim,

The easiest way to check your update is to run the SELECT subquery on its
own and see if it returns any rows.

If it doesn't then the criteria in your WHERE clause is not what it needs to
be OR the data in the corresponding fields is not matching as you expect
('1' will not = '01' or ' 1').

If the SELECT does return rows, then the query you're using to test the
success of the update is incorrect.

Jack


-----Original Message-----
From: Jim Thomas [mailto:oracledba-ezmlmshield-x60351592.[Email address
protected]
Sent: Wednesday, April 30, 2008 9:52 AM
To: LazyDBA Discussion
Subject: RE: UPDATE STATEMENT QUESTION

Dear Lazy DBA's



Is there any reason why the update statement below would not work.

besides the usual suspects-

I have a po_number in pop_lines where po_line_number = 1 and The
description field is blank

I also have a, identical po_number and po-line_number in temp_pop_lines
where the description is populated.



I get no errors, 'update complete' and then I commit. Yet the change
does not seem to take.



Any ideas?? Thank You

Regards

Jim Thomas







1 update pop_lines p

2 set p.purchase_line_detail_descr = (SELECT
purchase_line_detail_descr

3 FROM temp_pop_lines t

4 WHERE t.po_number =
p.po_number

5 and t.po_line_number =
p.po_line_number)

6 ;

7 commit

8 ;





---------------------------------------------------------------------
TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
To post a dba job: http://jobs.lazydba.com
To Subscribe : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html



The information contained in this email message and any attachments is
privileged and confidential and intended only for the recipient(s) or the
employee or agent responsible for delivery of this message to the intended
recipient(s). If you are not the recipient you may not copy or disclose the
information, or act upon it, and you should delete it entirely from your
email system. Please notify the sender that you received this email in
error. The views expressed in this communication may not necessarily be the
views held by the company.




---------------------------------------------------------------------
TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
To post a dba job: http://jobs.lazydba.com
To Subscribe : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html


**********************************************************************
This e-mail is confidential and may be privileged.
It may only be read, copied and used by the intended recipient.
If you have received it in error please contact the sender immediately
by return e-mail. Please then delete the e-mail and any copies of it
and do not use or disclose its contents to any person.
**********************************************************************
Registered Office: Farncombe House, Broadway, Worcestershire, WR12 7LJ

AccuRead Limited Registered Number: 3076187 England
GSL UK Limited Registered Number: 3333860 England
Global Solutions Limited Registered Number: 3189802 England
**********************************************************************



---------------------------------------------------------------------
TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
To post a dba job: http://jobs.lazydba.com
To Subscribe : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html



Irish Life Investment Managers winner of the Investment Management KPMG Financial Services Excellence Award 2007

**********************************************************************************
Irish Life Investment Managers Limited is authorised by the Financial Regulator. Irish Life Investment Managers Limited Registered Office: Beresford Court, Beresford Place, Dublin 1. Registered in Ireland Number 116000

While Irish Life Investment Managers uses reasonable efforts to ensure that the information contained in this email is current, accurate and complete at the date of publication, no representations or warranties are made (express or implied) as to the reliability, accuracy or completeness of such information. Irish Life Investment Managers therefore cannot be held liable for any loss arising directly or indirectly from the use of, or any action taken in reliance on, any information contained in this email.

This material is for information only and does not constitute an offer or recommendation to buy or sell any investment, or subscribe to any investment management or advisory service. It is intended for the use of institutional and other professional investors. Past performance is not indicative of future results. The value of funds we manage may fall as well as rise.

This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept for the presence of computer viruses.
**********************************************************************************



---------------------------------------------------------------------
TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
To post a dba job: http://jobs.lazydba.com
To Subscribe : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html



The information contained in this email message and any attachments is privileged and confidential and intended only for the recipient(s) or the employee or agent responsible for delivery of this message to the intended recipient(s). If you are not the recipient you may not copy or disclose the information, or act upon it, and you should delete it entirely from your email system. Please notify the sender that you received this email in error. The views expressed in this communication may not necessarily be the views held by the company.



Oracle LazyDBA home page