ORA-01031: insufficient privileges [message #627424] |
Tue, 11 November 2014 22:31 |
|
Hi,
Within a big package I have the below code:
EXECUTE IMMEDIATE
'create or replace view v_Check_custom as
select distinct ''Cytotoxics '' as "expression", Cytotoxics from check_custom union all
select distinct ''HormBC '' as "expression", HormBC from check_custom union all
select distinct ''LHRHas '' as "expression", LHRHas from check_custom union all
select distinct ''C10A1Ezet '' as "expression", C10A1Ezet from check_custom union all
select distinct ''Neurology '' as "expression", Neurology from check_custom union all
select distinct ''EarlyAndAdv_BC '' as "expression", EarlyAndAdv_BC from check_custom union all
select distinct ''standardreporti'' as "expression", standardreporting from check_custom union all
select distinct ''TArankings '' as "expression", TArankings from check_custom union all
select distinct ''HormPCM '' as "expression", HormPCM from check_custom union all
select distinct ''form_groups '' as "expression", form_groups from check_custom union all
select distinct ''Exanta_ac_mkt '' as "expression", Exanta_ac_mkt from check_custom'
;
This code is generating below error:
ORA-01031: insufficient privileges
ORA-06512: at "SCOTT.AZ_DATA_MANAGEMENT", line 3659
ORA-06512: at "SCOTT.AZ_DATA_MANAGEMENT", line 3812
ORA-06512: at line 2
01031. 00000 - "insufficient privileges"
But I can execute the same statement in anonymous PL/SQL block in same user:
begin
EXECUTE IMMEDIATE
'create or replace view v_Check_custom as
select distinct ''Cytotoxics '' expression, Cytotoxics from check_custom union all
select distinct ''HormBC '' expression, HormBC from check_custom union all
select distinct ''LHRHas '' expression, LHRHas from check_custom union all
select distinct ''C10A1Ezet '' expression, C10A1Ezet from check_custom union all
select distinct ''Neurology '' expression, Neurology from check_custom union all
select distinct ''EarlyAndAdv_BC '' expression, EarlyAndAdv_BC from check_custom union all
select distinct ''standardreporti'' expression, standardreporting from check_custom union all
select distinct ''TArankings '' expression, TArankings from check_custom union all
select distinct ''HormPCM '' expression, HormPCM from check_custom union all
select distinct ''form_groups '' expression, form_groups from check_custom union all
select distinct ''Exanta_ac_mkt '' expression, Exanta_ac_mkt from check_custom'
;
end;
In PL/SQL block it is not generating error.
Any idea to solve the issue please.
|
|
|
|
|
|
|
|
|