Question

When I call a PL/SQL of particular schema in Java file it is getting executed and retrieves the result. But when I call another PLSQL in the same Java file of different schema it shows an error saying:

Message: `ORA-06550: line 1, column 7: PLS-00201: identifier 'TEST2' must be declared ORA-06550: line 1, column 7: PL/SQL: Statement ignored` 

Example : There are two proc say A and B present in x schema and y schema

I am calling it under test.java file:

CallableStatement csforST= connection.prepareCall("{ call A() }"); 
csforST.execute();

It works fine.

But when I call:

CallableStatement cs= connection.prepareCall("{ call B() }"); 
cs.execute();

It displays an error saying B must be declared.

Était-ce utile?

La solution

Thank you very much Griffey you made my day. Yes what Griffy said is right. It is simple but spent one day to find it. Since i am new in calling stored proc.

Actually there will be a username and password given for making the connection. The username what i am using do not have permission for the another schema. Hence created a new connection with a userNaming having an access to that schema and then called the another proc. It works fine now :).

I guess it would be useful for the starters like me.

Thanks Griffey

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top