RE: Updating Table using select/ ORA-01427: single-row subquery returns more than one row error

RE: Updating Table using select/ ORA-01427: single-row subquery returns more than one row error

 

  

Jim Thomas

try this

SMALL UPDATE --------------------
1 update jpt_pop_lines j
2 set J.purchase_line_detail_descr=
3 (select T.purchase_line_detail_descr
4 from temp_pop_lines t
5 where po_number='0100196'
6 and po_line_number='1')

Regards
________________________________________
From: Jim Thomas [oracledba-ezmlmshield-x19079405.[Email address protected]
Sent: Tuesday, April 29, 2008 1:08 AM
To: LazyDBA Discussion
Subject: RE: Updating Table using select/ ORA-01427: single-row subquery returns more than one row error

I attempted a manual update using only 1 po_number and one
po_line_number
I still got the 'subquery returns more then one row error'

So I did a small query on both the po_number and po_line_number
and all was returned was the count of 1

Could this be due to the field I am attempting to update is a
VARCHAR2(4000)
and it has more than one line in the description field-

I'm grasping at straws here- but can we update a VARCHAR2(4000) without
any special operators?

Is there a way to bypass this error?

Thank You - Jim T
see below for queries

SMALL UPDATE --------------------
1 update jpt_pop_lines j
2 set purchase_line_detail_descr=
3 (select purchase_line_detail_descr
4 from temp_pop_lines t
5 where po_number='0100196'
6* and po_line_number='1')
SQL> /
(select purchase_line_detail_descr
*
ERROR at line 3:
ORA-01427: single-row subquery returns more than one row

SMALL RECORD QUERY ----------------
SQL> select count(*)
2 from jpt_pop_lines
3 where po_number='0100196'
4 and po_line_number='1'
5 ;
1

thanks again to all those who have taken the time to help me with this
very difficult issue

regards
Jim T


---------------------------------------------------------------------
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

Oracle LazyDBA home page