title: Oracle SQL alter table add column with current user name
body: <p>It was a 2 part question and I got the timestamp correctly.
  I'm on 12C and trying to do something like:</p>
  
  <pre><code>ALTER TABLE customers
      ADD modified_by (USER FROM DUAL);
  </code></pre>
  
  <p>Basically just columns in a table that show who modified the table and at what time they did so.</p>
  
  <p>I also tried </p>
  
  <pre><code>ALTER TABLE customers
      ADD last_modified TIMESTAMP;
  ALTER TABLE customers
      ADD modified_by USER;
  </code></pre>
  
  <p>and other combinations of keywords that I found on this site and other sites but none of them work.  </p>
  
  <p>We only learned dual in class but I'm looking for any way to do these.</p>
  
  <p>Edit:</p>
  
  <p>I now understand what was taught to me by the user with almost 1 million points.</p>
  
  <p>Still unsure how to do the username.
  Read this:
  <a href="https://docs.oracle.com/cd/B19306_01/server.102/b14237/statviews_2114.htm#REFRN20302" rel="nofollow noreferrer">https://docs.oracle.com/cd/B19306_01/server.102/b14237/statviews_2114.htm#REFRN20302</a></p>
  
  <p>and tried:</p>
  
  <pre><code>ALTER TABLE customers
      ADD modified_by USERNAME;
  </code></pre>
  
  <p>doesn't work get invalid datatype.</p>
  
  <p>Then saw this: <a href="https://www.techonthenet.com/oracle/questions/find_users.php" rel="nofollow noreferrer">https://www.techonthenet.com/oracle/questions/find_users.php</a></p>
  
  <p>and tried:</p>
  
  <pre><code>ALTER TABLE customers
      ADD modified_by USERNAME FROM DBA_USERS;
  </code></pre>
  
  <p>but getting invalid alter table option.  SQL is hard.</p>