Getting error while trying to alter table in an sql block

You cannot issue DDL as static SQL in a PL/SQL block. If you want to put those commands in a PL/SQL block, you’d need to use dynamic SQL, i.e.

BEGIN
  EXECUTE IMMEDIATE 'alter table table1 enable row movement';
  EXECUTE IMMEDIATE 'alter table table1 shrink space cascade';
END;
/

It may be easier, however, to just issue consecutive SQL statements rather than issuing a single PL/SQL block.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)