title: How to modify SQL INSERT query to fail if nested SELECT returns NULL
body: <p>I have a set of SQL queries that each is an insert statement that gets its values from other tables:</p>
  
  <pre><code>insert into table1 values (
          (select tableID from Table1 where Name = 'Name1'),
          (select tableID from Table2 where Name = 'Name2'),
          (select tableID from Table3 where Name = 'Name3')
  )
  </code></pre>
  
  <p>If the select statements can't find the value in the table (ie, if there is no 'Name1' in Table1), then that field becomes NULL.</p>
  
  <p>Aside from changing the table design to not allow NULL's, is there a way I can modify my SQL to fail rather than insert NULL, if the nested select statements can't find the specified value?</p>