× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



To expand upon Dennis reply..

This part of the statement:
(Select coalesce(b.LADD1,c.IWADD1),
coalesce(b.LADD2, c.iwadd2), coalesce(b.LADD3, c.iwadd3),
coalesce(b.LALWH,c.iwalws), coalesce(b.LCOUN,c.iwadd4),
coalesce(b.LDESC,c.iwdesc)
from ems40data.inwhs01p c
left outer join a4gjnlf.aa0000209 b
on a.iwwhs = b.lwhs
Where a.iwwhs = b.lwhs)

Is returning more then one row for at least one given value of b.iwwhs.

iwwhs is obviously not unique, but it needs to be.

Think about it from the system's perspective...

I've been given this row whose new values I'm supposed to get from
this other table. Unless there's only one matching row in the other
table how would I know which row's values to use?

What are the unique keys for inwhs01p and aa0000209? Can you use them?

If not, then you have to look at the rows returned for a given value
of iwwhs, and determine how to decide from which single row to pull
the values you what to use to update the table. Possible choices, if
there's a timestamp or date & time field(s) then you may be able to
determine the most recent (or the oldest). Otherwise, perhaps you
just use the first the system finds.

Once you come up with a description of how to decide, we can help
translate that into SQL if you need the help.

Charles




On Wed, May 26, 2010 at 9:18 PM, Darryl Freinkel
<dfreinkel@xxxxxxxxxxxxxxxxx> wrote:
I tried the options that Charles has recommended and some variations. All
return the same error message.



Update EMS40DATA.INWHS01P a  set (a.IWADD1, a.IWADD2, a.IWADD3, a.IWALWS,
a.IWADD4, a.IWDESC)   = (Select coalesce(b.LADD1,c.IWADD1),
coalesce(b.LADD2, c.iwadd2),  coalesce(b.LADD3, c.iwadd3),
coalesce(b.LALWH,c.iwalws),  coalesce(b.LCOUN,c.iwadd4),
coalesce(b.LDESC,c.iwdesc)  from ems40data.inwhs01p c  left outer join
a4gjnlf.aa0000209 b  on a.iwwhs = b.lwhs Where a.iwwhs = b.lwhs)



SQL State: 21000

Vendor Code: -811

Message: [SQL0811] Result of SELECT more than one row. Cause . . . . . :
The result table of a SELECT INTO statement, a subquery, or a subselect of a
SET statement contains more than one row.  The error type is 2. If the error
type is 1 then a SELECT INTO statement attempted to return more than one
row.  If the error type is 2 then a subselect of a basic predicate has
produced more than one row.  Only one row is allowed. Recovery  . . . :
Change the selection so that only one result row is returned and then try
the request again.  The DECLARE CURSOR, OPEN, and FETCH statements must be
used to process more than one result row.  For a subquery the IN, EXISTS,
ANY or ALL predicates can be used to process more than one result row.  If
one row was expected, there may be data errors, such as duplicate rows, that
are causing more than one row to be returned.



thanks

Darryl Freinkel

Assignment 400 Group, Inc.

Tel: 770.321.8562 ext 111 | Fax 770.321.8562 | 2247 La Salle Dr, Marietta
GA, 30062, USA | PO Box 72556, Marietta, GA 30007-2556



--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.