title: Informix: How to get the table contents and column names using dbaccess?
body: <p>Supposing I have:</p>
  
  <ul>
  <li>an Informix database named "my_database"</li>
  <li>a table named "my_table" with the columns "col_1", "col_2" and "col_3":</li>
  </ul>
  
  <p>I can extract the contents of the table by creating a <strong>my_table.sql</strong> script like:</p>
  
  <pre><code>unload to "my_table.txt"
  select * from my_table;
  </code></pre>
  
  <p>and invoking dbaccess from the command line:</p>
  
  <pre><code>dbaccess my_database my_table.sql
  </code></pre>
  
  <p>This will produce the <strong>my_table.txt</strong> file with contents like:</p>
  
  <pre><code>value_a1|value_a2|value_a3
  value_b1|value_b2|value_b3
  </code></pre>
  
  <p>Now, what do I have to do if I want to obtain the column names in the <strong>my_table.txt</strong>? Like:</p>
  
  <pre><code>col_1|col_2|col_3
  value_a1|value_a2|value_a3
  value_b1|value_b2|value_b3
  </code></pre>