title: Is it possible to refer to column names via bind variables in Oracle?
body: <p>I am trying to refer to a column name to order a query in an application communicating with an Oracle database. I want to use a bind variable so that I can dynamically change what to order the query by. </p>
  
  <p>The problem that I am having is that the database seems to be ignoring the order by column. </p>
  
  <p>Does anyone know if there is a particular way to refer to a database column via a bind variable or if it is even possible? </p>
  
  <p>e.g my query is </p>
  
  <pre><code>SELECT * FROM PERSON ORDER BY :1
  </code></pre>
  
  <p>(where <code>:1</code> will be bound to <code>PERSON.NAME</code>)
  The query is not returning results in alphabetical order, I am worried that the database is interpreting this as:-</p>
  
  <pre><code>SELECT * FROM PERSON ORDER BY 'PERSON.NAME' 
  </code></pre>
  
  <p>which will obviously not work.</p>
  
  <p>Any suggestions are much appreciated.</p>