title: Using INSTR and SUBSTR together
body: <p>See the below data below first, i need to calculate the columns HUB_NM, PRODUCT_NM and STRIP_NM from the first 2 columns as described. </p>
  
  <pre><code>DEAL_ORIGINATION EXCH_SYMBOL                                    HUB_NM     PRODUCT_NM            STRIP_NM
  ---------------- ---------------------------------------------- ---------- --------------------- ------------
  TT_ICE           IPE e-Gas Oil DEC 2010                                    IPE e-Gas Oil         DEC 2010
  GLOBEX           HO DEC 2010                                               HO                    DEC 2010
  ICE NG           Firm Phys, ID, GDD - Transco-45 - Next Day Gas Transco-45 NG Firm Phys, ID, GDD Next Day Gas
  STUSCO_ICE       Brent Crude Futures - North Sea - Dec12                   Brent Crude Futures   DEC12
  </code></pre>
  
  <p>I can't work out how to do it.  I know I should use SUBSTR and INSTR but I can't figure it out.</p>
  
  <p>A) How to get HUB_NM column value from EXCH_SYMBOL?</p>
  
  <pre><code>If T.DEAL_ORIGINATION =  'ICE'
  then
      Find 1st space dash space 
      Find 2nd space dash space
      Display the word in between, no space at the end 
  elsif T.DEAL_ORIGINATION in ('GLOBEX', 'TT_ICE', 'STUSCO_ICE')
  then 
      null;
  end if;
  </code></pre>
  
  <p>B) How to get PRODUCT_NM column value from EXCH_SYMBOL?</p>
  
  <pre><code>If T.DEAL_ORIGINATION in ( 'ICE',  'STUSCO_ICE')
  then
      Display from 1st character to the 1st dash, no space at the end 
  elsif T.DEAL_ORIGINATION in ('GLOBEX', 'TT_ICE',)
  then 
      Remove -9 caharacters from the end of the word and display the fornt word, no space at the end 
  end if;
  </code></pre>
  
  <p>C) How to get STRIP_NM column value from EXCH_SYMBOL?</p>
  
  <pre><code>If T.DEAL_ORIGINATION in ( 'ICE',  'STUSCO_ICE')
  then
      Find the 2nd space dash space
      Display from then on to the end of the word, no space at the end 
  elsif T.DEAL_ORIGINATION in ('GLOBEX', 'TT_ICE',)
  then 
      Display the last -8 caharacters from the end of the word, no space at the end 
  end if;
  </code></pre>