title: Oracle's SQL - How to get user input and search it in a query
body: <p>I have a database with menus and items, with a relationship between the two so that items can go on menus.</p>
  
  <p>I want a select statement that can get varchar2 input from the user, and then check if the inputted value is part of the name of any items on the menus.</p>
  
  <p>For example, if the user was to input 'strawberry' I would want the query to output all menus with corresponding items that have the word 'strawberry' in them. Like...</p>
  
  <pre><code>Menu                     Item
  --------------------     -----------------------------
  Valentine Theme          Chocolate covered strawberry       
  Red Drink Theme          Strawberry Margarita
  Red Drink Theme          Strawberry sensation
  </code></pre>
  
  <p>[How] is this possible? Here's what I've tried so far, and both have failed...</p>
  
  <p><strong>Try 1</strong> :</p>
  
  <pre><code>select menu_name Menu, item_name Item
  from menu m, item_for_menu i_m, item i
  where m.menu_id=i_m.menu_id
      and i.item_id=i_m.item_id
      (and item_name = '&amp;name_of_item'
      or item_name like '%name_of_item%');
  </code></pre>
  
  <p><strong>Try 2</strong> (after some googling):</p>
  
  <pre><code>accept item_in prompt 'What item do you want to search for? '
  
  select menu_name Menu, item_name Item
  from menu m, item_for_menu i_m, item i
  where m.menu_id=i_m.menu_id
      and i.item_id=i_m.item_id
      and item_name like item_in;
  
  undefine item_in
  </code></pre>