title: SQL Command to replace embedded spaces with another character
body: <p>I have a relational database with several fixed length character fields. I need to permanently replace all the embedded spaces with another character like <code>-</code> so <code>JOHN DOE</code>  would become <code>JOHN-DOE</code> and <code>ITSY BISTSY SPIDER</code> would become <code>ITSY-BISTSY-SPIDER</code>. I can search before hand to make sure there are no strings that would conflict. I just need to be able to print the requested files with no embedded spaces. I would do the replacement in the C code but I want to make sure that there is never a future case where there is a <code>JANE DOE</code> and <code>JANE-DOE</code> in the DB.</p>
  
  <p>By the way I have already made sure that there are no strings with more than one consecutive embedded space or leading spaces only trailing spaces to fill the fixed length fields.</p>
  
  <p><em>Edit</em>: thanks for all the help!</p>
  
  <p>It looks like when I cut &amp; pasted my question from Word to StackOverflow the trailing spaces got lost so the meaning my question was lost a bit.</p>
  
  <p>I need to replace only the embedded spaces not the trailing spaces!</p>
  
  <p>Note: I am using middle dot to stand in for spaces that don't show well.</p>
  
  <p>Using:</p>
  
  <pre><code>SELECT REPLACE(operator_name, ' ', '-') FROM operator_info ;
  </code></pre>
  
  <p>the string <code>JOHN·DOE············</code> became <code>JOHN-DOE------------</code>.</p>
  
  <p>I need <code>JOHN-DOE············</code>.</p>
  
  <p>I am thinking I need to use aliasing and the <code>TRIM</code> command but not sure how.</p>