I am able to create the basic "Hello World" Stored Procedure just fine. The problem is when I try to call it.
This is what I've done.
Created Table
@echo true;
@autocommit true;
CREATE TABLE PUB.HelloWorld(
fld1 char(20)
);
COMMIT WORK;
Created Stored Procedure
@echo true;
@autocommit true;
CREATE PROCEDURE PUB.spHelloWorld ()
BEGIN
SQLIStatement Insert_HelloWorld = new SQLIStatement (
"INSERT INTO PUB.HelloWorld(fld1) values ('Hello World!')");
Insert_HelloWorld.execute();
END;
COMMIT WORK;
Call Stored Procedure
@echo true;
@autocommit true;
CALL PUB.spHelloWorld();
Commit;
This is the output I get back
=== Statement 1. ===
@echo true
Ok: Echo true. (8932);
=== Statement 2. ===
@autocommit true
Ok: AutoCommit true. (8932);
=== Statement 3. ===
CALL PUB.spHelloWorld();
=== SQL Exception 1 ===
SQLState=HY000
ErrorCode=-210022
[JDBC Progress Driver]:.
Errors 1.
=== Statement 4. ===
Commit;
Statements: 4; Updates 0; Rows 0; Errors: 1; Warnings: 0. (8926)
ANY IDEAS?
This is what I've done.
Created Table
@echo true;
@autocommit true;
CREATE TABLE PUB.HelloWorld(
fld1 char(20)
);
COMMIT WORK;
Created Stored Procedure
@echo true;
@autocommit true;
CREATE PROCEDURE PUB.spHelloWorld ()
BEGIN
SQLIStatement Insert_HelloWorld = new SQLIStatement (
"INSERT INTO PUB.HelloWorld(fld1) values ('Hello World!')");
Insert_HelloWorld.execute();
END;
COMMIT WORK;
Call Stored Procedure
@echo true;
@autocommit true;
CALL PUB.spHelloWorld();
Commit;
This is the output I get back
=== Statement 1. ===
@echo true
Ok: Echo true. (8932);
=== Statement 2. ===
@autocommit true
Ok: AutoCommit true. (8932);
=== Statement 3. ===
CALL PUB.spHelloWorld();
=== SQL Exception 1 ===
SQLState=HY000
ErrorCode=-210022
[JDBC Progress Driver]:.
Errors 1.
=== Statement 4. ===
Commit;
Statements: 4; Updates 0; Rows 0; Errors: 1; Warnings: 0. (8926)
ANY IDEAS?
