From: Peter Headland on
I have an application which, among other things, needs to modify a DB2
schema via JDBC. Up until now, I have been getting along very well,
but today I needed to drop a column. That in itself was no problem,
but having dropped the column, I discovered I needed to reorg its
parent table before I could perform any further operations on it. I
quickly discovered that I could not do REORG TABLE via JDBC. Is this
really true, or is there just some trick I have missed? If it is true,
is there some equivalent mechanism I can use via JDBC (i.e. without
using any proprietary interfaces)?
From: Peter Headland on
Hm - I think I am making an unproven assertion when I say that the
column drop is causing the reorg requirement - I am also doing a few
other operations on that table. So please don't get hung up on WHY I
need a reorg, just focus on how I can do the equivalent via JDBC.
From: Peter Headland on
OK - I isolated the DDL down to the equivalent of this:

ALTER TABLE t DROP COLUMN d;
UPDATE t SET c = 42;

And it fails requiring a reorg. This works, but I can't do it via
JDBC:

ALTER TABLE t DROP COLUMN d;
REORG TABLE t;
UPDATE t SET c = 42;

--
Peter Headland
From: Peter Headland on
Slaps forehead - I still forget dynamic statements! The solution is to
call SYSPROC.ADMIN_CMD ('REORG TABLE t'), which I can do via JDBC.


However, when I do that, I get: "REMOTE OPERATION INVALID FOR
APPLICATION EXECUTION ENVIRONMENT"

What do I do now?

--
Peter Headland
From: Lennart Jonsson on
On 2010-05-22 02:14, Peter Headland wrote:
> Slaps forehead - I still forget dynamic statements! The solution is to
> call SYSPROC.ADMIN_CMD ('REORG TABLE t'), which I can do via JDBC.
>
>
> However, when I do that, I get: "REMOTE OPERATION INVALID FOR
> APPLICATION EXECUTION ENVIRONMENT"

What exactly is the error message (including sqlstate et al)?


/Lennart