Can the problem of naming not be sorted out by:
Connection conn;
//conn = .... here
String sep = conn.getMetaData().getCatalogSeparator();
//in the SQL string use:
"lib" + sep + "table"
I think that the problem Wayne is having is not caused by the "."
separator. I was having a similar problem on V4R5. Wayne, can you try
modify the statement to:
update mydb.table1 set mydb.table1.name = (select mydb.table2.name
from mydb.table2 where mydb.table1.id = mydb.table2.id);
and see what happens. If this above works for Wayne, can somebody
explain it?
Thanks
-Marcin Jekot
> From: "Price, Chris" <chris_price@nsb.co.uk>
> To: "'java400-l@midrange.com'" <java400-l@midrange.com>
> Subject: RE: DB2 SQL problem -- Urgent help needed
> Date: Thu, 6 Jun 2002 14:46:52 +0100
> Reply-To: java400-l@midrange.com
>
> That's what I'm thinking may be the problem.
>
> I'm not sure where the iSeries stores the default value for this.
>
> The safest thing to do is set the "naming" property to "sql" in the
> JDBC
> driver url in your application.
>
> Chris.
>
> > > -----Original Message-----
> > > From: Weining Xu [mailto:xu_weining@yahoo.com]
> > > Sent: 06 June 2002 14:07
> > > To: java400-l@midrange.com
> > > Subject: DB2 SQL problem -- Urgent help needed
> > >
> > > Hi all,
> > >
> > > We developed an Java program on AS400 V5R1 machine
> > > by
> > > using native DB2 JDBC driver. Then we deploy the
> > > program on an AS400 V4R5 machine, also using
> > native
> > > DB2 JDBC driver. Both matchines use JDK1.2.2.
> > Some
> > > SQL statements are not working on the depolyment
> > > AS400. An example is update record with subselect.
> > > A
> > > simplfied SQL is:
> > >
> > > update mydb.table1 t1 set t1.name = (select
> > t2.name
> > > from mydb.table2 t2 where t1.id = t2.id);
> > >
> > > I got:
> > > [SQL0104] Token . was not valid. Valid tokens: =.
> > >
> > > The exactly same SQL works fine on V5R1 machine.
> > So
> > > it should not be the problem of SQL. It seems like
> > > the
> > > V4R5 does not accept subselect SQL syntax, since
> > all
> > > simple select, insert, update and delect are
> > working
> > > fine.
> > >
> > > What could be wrong? Does we missing any PTFs?
> > >
> > > Wayne (Weining) Xu
> > >
__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com