title: SQL Query to convert TIMESTAMP to String while selecting the columns
body: <p>I am using DB2 database. I have a table and it has two columns as below:</p>
  
  <p>Table name is <code>sample</code>:
  Below are the columns:</p>
  
  <pre><code>CRDATTIM TIMESTAMP NOT NULL , 
  
  RECORDCD CHAR(1) CCSID 37 NOT NULL; 
  </code></pre>
  
  <p>The above table has the below values:</p>
  
  <pre><code>   CRDATTIM                                   RECORDCD 
  
  2014-08-08 12:12:39.621060                  O   
  2014-08-27 07:01:46.814080                  T   
  2014-08-27 06:41:47.404080                  T   
  2014-08-27 07:14:47.871080                  T   
  2014-08-28 02:23:50.390080                  T   
  2014-08-28 06:27:58.298080                  T   
  2014-09-02 08:57:37.607080                  T
  </code></pre>
  
  <p>Now I want to select all the columns of the table <code>sample</code>(select * from sample)by converting the values under <code>CRDATTIM</code> column to string, not as <code>TIMESTAMP</code>. </p>
  
  <p>For example the value under the column <code>CRDATTIM</code> <code>2014-08-08 12:12:39.621060</code> should be returned as <code>2014-08-08-12.12.39.621060</code>.</p>
  
  <p>Similarly </p>
  
  <p>2014-08-27 07:01:46.814080  should be returned as 2014-08-27-07.01.46.814080 </p>
  
  <p>and so on</p>
  
  <p>Any thoughts on how to achieve this?</p>