Request that the tools options support the Explain Plan window type.
e.g.
Our database has different schemas for different countries with the same table structure (don't ask why).
The first thing that is done in the session is changing CURRENT_SCHEMA:
if country_cd = 'US' then v_schema := 'US_USER';
elsif country_cd = 'UK' then v_schema := 'UK_USER';
end if;
Execute immediate 'alter session set current_schema = ' || v_schema;
Now all our queries can be like:
select * from employees;
instead of
select * from us_user.employees;
which would require dynamic sql.
The only problem with this is that it does not work in the explain plan window. Especially since we the developers, cannot log in as the schema owner.
Along the same lines, I have created a descendant of TOracleSession that exposes a SessionParams array (using a TStrings property which allows for future Oracle variables). This allows me to set these at designtime or write code such as:
session.SessionParams['current_schema'] := 'uk_user';
which will then execute the alter session command.
Could you add this to the session component too?
e.g.
Our database has different schemas for different countries with the same table structure (don't ask why).
The first thing that is done in the session is changing CURRENT_SCHEMA:
if country_cd = 'US' then v_schema := 'US_USER';
elsif country_cd = 'UK' then v_schema := 'UK_USER';
end if;
Execute immediate 'alter session set current_schema = ' || v_schema;
Now all our queries can be like:
select * from employees;
instead of
select * from us_user.employees;
which would require dynamic sql.
The only problem with this is that it does not work in the explain plan window. Especially since we the developers, cannot log in as the schema owner.
Along the same lines, I have created a descendant of TOracleSession that exposes a SessionParams array (using a TStrings property which allows for future Oracle variables). This allows me to set these at designtime or write code such as:
session.SessionParams['current_schema'] := 'uk_user';
which will then execute the alter session command.
Could you add this to the session component too?