What is the problem in below plsql? I am running this code in sql developer.
BEGIN
FOR x IN (SELECT * FROM dba_tables WHERE owner = 'ABPPMGR_TE2' AND table_name IN
(select object_name from dba_objects where object_type = 'MATERIALIZED VIEW' and status = 'VALID')
)
LOOP
dbms_stats.gather_table_stats( x.owner, x.table_name);
END LOOP;
END;
It gives the error:
ORA-06550: line 2, column 2: PLS-00103: Encountered the symbol " " when expecting one of the following: ( begin case declare exit for goto if loop mod null pragma raise return select update while with << continue close current delete fetch lock insert open rollback savepoint set sql execute commit forall merge pipe purge The symbol " " was ignored.
FOR
andx
, indicating something odd there; you actually have a non-breaking space at the start of that line, and there are five others in that block. Replacing those with normal spaces, or just copying and pasting the code from this question (as displayed above, not the raw markdown text in edit mode), would have solved it. – Alex Poole