Consultor Eletrônico



Kbase P11742: Compilation of a SQL-92 stored procedure fails when the getValue method is called
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   15/10/2008
Status: Verified

FACT(s) (Environment):

Progress 9.1D

SYMPTOM(s):

Compilation of a SQL-92 stored procedure fails when the getValue method is called

CAUSE:

A stored procedure similar to the following caused the problem:

CREATE PROCEDURE test()
BEGIN
 SQLIStatement test = new SQLIStatement("select name from customer");
 test.execute();
 String name = (String) test.getValue(1, CHARACTER);
END
;
COMMIT;

The cause of the problem is that the getValue() method call does not work against a SQLIStatement object (which is documented that it does not return a resultset).

FIX:

The Java code must be changed to use a SQLCursor (which does generate a resultset). Sample code is shown below.

CREATE PROCEDURE test()
BEGIN
SQLCursor test = new SQLCursor("select name from customer");
test.open();
test.fetch();
 String name = (String) test.getValue(1, CHARACTER);
END
;
COMMIT;