Using an Oracle PL/SQL block in pre SQL
Is it possible to use an Oracle anonymous block in pre SQL? I would prefer that over the overhead of having to create a stored procedure since the action being taken only takes place in one location.
Should be possible - just put a backslash before each semi-colon.
cursor bitmaps is
where index_type = 'BITMAP'
and table_name in ('X', 'Y')\;
FOR bitmaps_rec in bitmaps
execute immediate 'alter index '||bitmaps_rec.index_name||' unusable'\;