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



Problem resolved.  Can not qualify to set fieldName
when there is a subselect.

So if there is a subselect:
update t1.name set name = (select ......);   WORK!
update t1.name set t1.name = (select ......);   not
WORK!

if no subselect:
update t1.name set name = aValue;  WORK!
update t1.name set t1.name = aValue; WORK!

But on V5R1, it works for all above situations, don't
know why.

Thanks for all of you to help me with this issue.

Wayne





--- Raul A Jager <raul@abc.com.py> wrote:
> I had problems with the update from a subselect when
> the file with the new data is not one
> to one with the old.  In that case, you need to
> update only the records that have a match,
> or set the field as "null capable", in this case you
> may loose data.
>
> Someting like this:
>
> update t1 set data1 = (select data2 from t2 where
> key2 = t1.key2) where key1 in (select
> key2 from t2)
>
________________________________________________________________________________
> Weining Xu wrote:
>
> > Yes, all simple update, insert, delete statements
> > works.  So far only subselect inside an update
> > statement does not work.
> > --- "Clapham, Paul" <pclapham@core-mark.com>
> wrote:
> > > Have you already tried just plain "set name =
> ..."?
> > >
> > > PC2
> > >
> > > -----Original Message-----
> > > From: Weining Xu [mailto:xu_weining@yahoo.com]
> > > Sent: June 6, 2002 09:00
> > > To: java400-l@midrange.com
> > > Subject: Re: DB2 SQL problem -- Urgent help
> needed
> > >
> > >
> > > I tried both slash and dot in both strsql and
> > > Operations Navigator.  The error is the same.
> > >
> > > strsql tells that Token dot error occors at "set
> > > t1.name ".
>
> _______________________________________________
> This is the Java Programming on and around the
> iSeries / AS400 (JAVA400-L) mailing list
> To post a message email: JAVA400-L@midrange.com
> To subscribe, unsubscribe, or change list options,
> visit:
> http://lists.midrange.com/cgi-bin/listinfo/java400-l
> or email: JAVA400-L-request@midrange.com
> Before posting, please take a moment to review the
> archives
> at http://archive.midrange.com/java400-l.
>


__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com


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.