My question is over here that I just wann to pass 'Scott' schema name as dynamic,because schema name has changed every 2 month like 'scott.1' and ' scott.2' and so on.
Select prod_id,prod_name from product A,scott.product_details B where A.prod_id=B.prod'id;
There are a couple of things you could look into:
Use synonyms/views so you don't need to specify the schema:
grant dba to other_user
identified by other_user;
create table other_user.t (
c1 int
);
insert into other_user.t values ( 42 );
select * from other_user.t;
C1
42
create synonym t
for other_user.t;
select * from t;
C1
42
Set the current_schema to the other schema:
drop synonym t ;
alter session set current_schema = other_user;
select * from t;
C1
42
Though if you're using tables from different schemas (as implied by your example), you'll need to give the schema for your current user.
But... why do you need to change the schema
name regularly?