title: Escaping ampersand character in SQL string
body: <p>I am trying to query a certain row by name in my sql database and it has an ampersand. I tried to set an escape character and then escape the ampersand, but for some reason this isn't working and I'm uncertain as to what exactly my problem is.</p>
  
  <pre><code>Set escape '\'
      select * from V1144engine.T_nodes where node_id in(
      select node2_id from V1144engine.T_edges where node1_id in(
      select node2_id from V1144engine.T_edges where node1_id in(
      select node2_id from V1144engine.T_edges where node1_id = 
        (select node_id from V1144engine.T_nodes where node_name = 'Geometric Vectors \&amp; Matrices')))
      and edge_type_id = 1)
      and node_type_id = 1
      and node_id in (
      select node2_id from V1144engine.T_edges where node1_id =
        (select node_id from V1144engine.T_nodes where node_name = 'Algebra II')
      and edge_type_id = 2);
  </code></pre>
  
  <p>Although this has a similar solution to <a href="https://stackoverflow.com/questions/118190/how-do-i-ignore-ampersands-in-a-sql-script-running-from-sql-plus">this question</a>, the problems are posed very differently. They may end up having the same solution, but that does not mean that the questions are the same.</p>