I trying to create a materialized view using a procedure, but I did something wrong. I need this because I will schedulle the job on the server. Example... My script is:
create or replace procedure proc_teste_delago
is
begin
execute immediate 'create materialized view mv_test01
refresh force on demand
as
select
campo1,
campo2,
(case campo3
when 'aa' then 'AA'
when 'xx' then 'XX'
when 'ym' then 'YM'
else
'OO' as campo4
from mv_table01_test'
end;
The error received is: ORA-06550: linha 2, coluna 7: PLS-00905: object PROC_TESTE_DELAGO is invalid ORA-06550: linha 2, coluna 7: PL/SQL: Statement ignored
Some help will be good. Obs.: It's my first time working with Oracle.