title: How to insert conditionally in Oracle?
body: <p>I've read <a href="http://psoug.org/snippet/INSERT-WHEN_588.htm" rel="noreferrer">here</a> that the syntax looks like this:</p>
  <pre><code>INSERT
  WHEN ([Condition]) THEN
  INTO [TableName] ([ColumnName])
  VALUES ([VALUES])
  ELSE
  INTO [TableName] ([ColumnName])
  VALUES ([VALUES])
  SELECT [ColumnName] FROM [TableName];
  </code></pre>
  <p>But I don't want to provide values from another table. I just want to type them, so I've got:</p>
  <pre><code>INSERT 
  WHEN EXISTS (SELECT 1 FROM FOO WHERE NAME = 'JOE') 
  THEN
  INTO BAR (NAME, AGE) 
  VALUES ('JOE', 50)
  </code></pre>
  <p>and this produces exception: ORA-00928: missing SELECT keyword.</p>
  <p>I want to perform an insert if given value is found in another table.</p>