title: ERROR at line 1: ORA-00911: invalid character ORA-06512: at line 17
body: <p>I am not a frequent user of database &amp; once in a while i need to create/run/execute a few PL/SQL blocks. I have a similar situation right now, where I have the below block which while executing as SYS as SYSDBA in oracle database user throws the error :-</p>
  
  <pre class="lang-html prettyprint-override"><code>DECLARE 
  *
  ERROR at line 1:
  ORA-00911: invalid character
  ORA-06512: at line 17
  </code></pre>
  
  <p>The PL/SQL Block is as below :-</p>
  
  <pre class="lang-html prettyprint-override"><code>DECLARE
  TYPE RefCurTyp IS REF CURSOR;
  alter_tbl VARCHAR2(200);
  a_null  CHAR(1);
  tbl VARCHAR2(200);
  clmn VARCHAR2(200);
  dtyp VARCHAR2(200) ;
  dlth VARCHAR2(200);
  c RefCurTyp;
  BEGIN
  open c for 'select utc.table_name, utc.column_name, utc.data_type, utc.data_length FROM user_tab_columns utc,  user_tables ut
  WHERE utc.data_type = ''VARCHAR2'' AND utc.char_used =''B''  AND ut.table_name = utc.table_name';
  LOOP
  dbms_output.put_line(clmn);
  FETCH c INTO tbl, clmn, dtyp, dlth;
  EXIT WHEN c%NOTFOUND;
  EXECUTE IMMEDIATE
  'alter table '||tbl||' modify ('||clmn||' '||dtyp||'('||dlth||' CHAR))';
  END LOOP;
  CLOSE c;
  END;
  </code></pre>
  
  <p>Even after pounding my head on it for 3 days i am unable to figure out the issue with this. Any input is appreciated.</p>
  <p>While executing the same code via TOAD i get :-
  <a href="https://i.stack.imgur.com/edQ4B.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/edQ4B.png" alt="enter image description here" /></a></p>