PLS-00905: object is invalid
709026Jul 23 2009 — edited Jul 23 2011Hi all,
I'm currently wokring with someone else's SQL code and running it through JDBC under Java 1.5 with an Oracle 10g database on a Windows XP machine.
My problem is that I am loading java procedures as follows:
loadjava -u " + username + "/" + password + "@" + dbName + " -v -resolve \"" + System.getProperty("user.dir") + System.getProperty("file.separator") + "JavaClass.java\"");
This is successfull.
However I then run the following queries:
create or replace function javaFunction(code NUMBER) return java_varray as language java name 'JavaClass.javaFunction(long) return oracle.sql.ARRAY';
and then:
declare
cursor codes
is
select *
from pTable;
code_list java_varray;
begin
for p_rec in p_codes
loop
code_list := javaFunction(pr_rec.code);
forall i in (code_list.FIRST + 1) .. (code_list(1)/2)
insert into TESTTABLE(Code, Pset, IP, Orientation) values(code_list(i), p_rec.Pset, p_rec.IP, 'F');
forall i in (code_list(1)/2)+1 .. code_list(1)
insert into TESTTABLE(Code, Pset, IP, Orientation) values(code_list(i), p_rec.Pset, p_rec.IP, 'R');
end loop;
insert into Result(Pset, IP,CH, LOCATION,Orientation)
select Pset, IP, Ch, LOCATION, Orientation
from TESTTABLE, TESTSEQ
where TESTTABLE.Code = TESTSEQ.CODE;
execute immediate 'truncate table TESTTABLE';
commit;
end;
but this throws the following error:
java.sql.SQLException: ORA-06550: line 11, column 20:
PLS-00905: object SYSTEM.javaFunction is invalid
ORA-06550: line 11, column 7:
PL/SQL: Statement ignored
Does anyone have an idea what I'm doing wrong?
Any help would be much appreciated.
Martin