Derby 10.8.2.2

The query that I am doing is this:

#!/bin/sh

DERBY_HOME=/opt/canoga/canogaview/glassfish/javadb
export DERBY_HOME

$DERBY_HOME/bin/ij <<EOF

CONNECT 'jdbc:derby://localhost:1527/csemdb';

CALL SYSCS_UTIL.SYSCS_SET_RUNTIMESTATISTICS(1);
CALL SYSCS_UTIL.SYSCS_SET_XPLAIN_SCHEMA('PCS_V1');
CALL SYSCS_UTIL.SYSCS_SET_XPLAIN_MODE(1);

SELECT
r.MasterIp
FROM PCS_V1.NPAResults r
WHERE ReportKey >= '2012-02-10 00:00:00.0'
AND ReportKey <= '2012-02-14 23:59:59.0'
AND (r.ResultFlag = 0 OR (r.ResultFlag <> 0 AND r.RoundTripPackets > 0));

CALL SYSCS_UTIL.SYSCS_SET_RUNTIMESTATISTICS(0);
CALL SYSCS_UTIL.SYSCS_SET_XPLAIN_SCHEMA('');
CALL SYSCS_UTIL.SYSCS_SET_XPLAIN_MODE(0);

EXIT;
<<EOF

The output of this is:

ij version 10.8
ij> ij> Statement executed.
ij> Statement executed.
ij> Statement executed.
ij> > > > > > ERROR XCL16: ResultSet not open. Operation 'getMetaData' not 
permitted. Verify that autocommit is OFF.
ij> Statement executed.
ij> Statement executed.
ij> Statement executed.
ij>


So the actual SELECT is returning this error.  When run with "call 
SYSCS_UTIL.SYSCS_SET_XPLAIN_MODE(0);" the query is run with no error.

I am trying to get the query plan that would be used without executing the 
query.

So is this a bug or am I doing something wrong?

Brett

Reply via email to