title: column new_value and display type and value of a variable
body: <pre><code>column dcol new_value mydate noprint
  select to_char(sysdate - case
                      when to_char(sysdate, 
  'hh24:mi:ss') between '17:00:00' and '23:59:59' then 0
                      when to_char(sysdate, 
  'hh24:mi:ss') between '00:00:00' and '17:00:00' then 1
                  end,'YYYYMMDD') dcol
  from dual;
  
  set feedback off
  
  spool "C:\test\test_&amp;mydate..csv";
  
  select /*csv*/ * from REPORTS.TEST;
  
  spool off;
  </code></pre>
  
  <p>Hi,</p>
  
  <p>I have the above SQL query that was written by someone else. I'm trying to understand and follow it.
  I have the following questions - wonder if someone could help me with them?</p>
  
  <p>1) There are 2 instances of 'dcol' in the query:
  a) column dcol, then b) select dcol from dual. Is 'dcol' a column name from dual table? It seems that if I replace 'dcol' with 'random_col' - 
  the query still work the same</p>
  
  <p>2) "C:\test\test_&amp;mydate..csv"; why is there a double '.' as opposed to single '.' right before 'csv'?</p>
  
  <p>3) How do I debug the SQL query in Oracle SQL Developer? For example, in the following:</p>
  
  <pre><code>select to_char(sysdate - case
                      when to_char(sysdate, 
  'hh24:mi:ss') between '17:00:00' and '23:59:59' then 0
                      when to_char(sysdate, 
  'hh24:mi:ss') between '00:00:00' and '17:00:00' then 1
                  end,'YYYYMMDD') dcol
  from dual;
  </code></pre>
  
  <p>I want to find out: a) what is the value of sysdate?, b) which case, select falls into?</p>
  
  <p>4) If at the end of the SQL query, I add: Define mydate; I would get the following output:</p>
  
  <p>DEFINE MYDATE          = "20181126" (VARCHAR2)</p>
  
  <p>Is there other ways to display what the variable mydate is and its type?</p>