title: oracle pl/sql compare value against database in function
body: <p>I have several names like:</p>
  
  <pre><code>john arnold 
  edward albert 
  </code></pre>
  
  <p>And I have a name dictionary like this:</p>
  
  <pre><code>name 
  ---------------------------  
  john   
  arnold 
  edward 
  </code></pre>
  
  <p>I wrote a function to split the name in parts and compare each part against the dictionary (so edward gets compared against the dictionary, then albert will get compared to the dictionary).</p>
  
  <p>My problem is that I would like to return a concatenated string of all the names that don't exist in the dictionary, for example if the name arrives like this:</p>
  
  <pre><code>john albert adam gerard
  </code></pre>
  
  <p>It should return:</p>
  
  <pre><code>adam gerard
  </code></pre>
  
  <p>I put the names in an array and search for them like this:</p>
  
  <pre><code>select name into name_base from usr_pre_pub.nd where name=names(ix);
  </code></pre>
  
  <p>But when a name isn't found on the dictionary, the execution halts and doesn't continue analysing the following names in the array.</p>
  
  <pre><code>john (found)  albert(found) adam (not found, exception no data found) gerard (not analysed)
  </code></pre>
  
  <p>I've removed the exception catching part of the function:</p>
  
  <pre><code>   exception     
     when no_data_found then
         return ix;
       when others then
       return 'others';
         -- consider logging the error and then re-raise
         raise;
  </code></pre>
  
  <p>But then it just stops and doesn't return a value.</p>
  
  <p>I don't know where to go from here, and hope you can help me on this one.</p>