default schemaname does not work woth OraPackage

To make our application more flexible we want to leave out schemanames by calling:
ALTER SESSION SET CURRENT_SCHEMA=OURDATAOWNER

This works OK for queries, but when calling stored procedures and/or functions leaving out the schemaname is not accepted. I get exceptions saying the object is not known. As soon as I prefix the schemaname before the stored procedure name everything works again.

I am using TOraclePackage.CallXXXFunction and TOraclePackage.CallProcedure. Is current_schema not supported for this ?
 
There is no explicit support required. The TOraclePackage component just runs the PL/SQL as specified. You can set TOraclePackage.Debug to True to see what happens.
 
Debug got me the information I wanted. The error was not in the TOraclePackage itself but in the way the package name and procedure name were passed. The code that separated the package name from the procedurename was not modified to accept calls without a schemaname. I corrected that, and things work OK now without schemaname if the current_schema setting is used in the session.

Sorry, my mistake.
 
OK like this, but is there any way to set schema name as a design/runtime Toraclesession property without manually executing alter session ?

regards
altin
 
Back
Top