title: teradata export query using cmd windows not working
body: <p>new post :
  i already read tutorial and i found this script</p>
  
  <pre><code>.LOGMECH LDAP;
  .LOGON  xx.xx.xx.xx/username,password;
  .LOGTABLE dbname.LOG_tablename;
  DATABASE dbname;
  .BEGIN EXPORT SESSIONS 2;
  .EXPORT OUTFILE D:\test.txt
  MODE RECORD format text;
  
  select a.my_date,b.name2,a.value from dbsource.tablesource a
  inner join dbname.ANG_tablename b
  on a.name1=b.name2
  where value=59000
  and a.my_date &gt;= 01/12/2015
  ;
  
  .END EXPORT;
  .LOGOFF;
  </code></pre>
  
  <p>but it is like not working</p>
  
  <pre><code>D:\&gt;bteq &lt; dodol.txt
  BTEQ 15.00.00.00 Tue Jan 05 14:40:52 2016 PID: 4452
  
  +---------+---------+---------+---------+---------+---------+---------+----
  .LOGMECH LDAP;
  +---------+---------+---------+---------+---------+---------+---------+----
  .LOGON  xx.xx.xx.xx/username,
  
   *** Logon successfully completed.
   *** Teradata Database Release is 13.10.07.12
   *** Teradata Database Version is 13.10.07.12
   *** Transaction Semantics are BTET.
   *** Session Character Set Name is 'ASCII'.
  
   *** Total elapsed time was 4 seconds.
  
  +---------+---------+---------+---------+---------+---------+---------+----
  .LOGTABLE dbname.LOG_tablename;
   *** Error: Unrecognized command 'LOGTABLE'.
  +---------+---------+---------+---------+---------+---------+---------+----
  DATABASE dbname;
  
   *** New default database accepted.
   *** Total elapsed time was 2 seconds.
  
  
  +---------+---------+---------+---------+---------+---------+---------+----
  .BEGIN EXPORT SESSIONS 2;
   *** Error: Unrecognized command 'BEGIN'.
  +---------+---------+---------+---------+---------+---------+---------+----
  .EXPORT OUTFILE D:\test.txt
   *** Warning: No data format given. Assuming REPORT carries over.
   *** Error: Expected FILE or DDNAME keyword, not 'OUTFILE'.
  +---------+---------+---------+---------+---------+---------+---------+----
  MODE RECORD format text;
  
  MODE RECORD format text;
       $
   *** Failure 3706 Syntax error: expected something between the beginning of
   the request and the 'MODE' keyword.
                  Statement# 2, Info =6
   *** Total elapsed time was 1 second.
  
  
  +---------+---------+---------+---------+---------+---------+---------+----
  
  select a.my_date,b.name2,a.value from dbsource.tablesource a
  inner join dbname.ANG_tablename b
  on a.name1=b.name2
  where value=59000
  and a.my_date &gt;= 01/12/2015
  ;
  </code></pre>
  
  <p>old post :</p>
  
  <p>I am new in teradata, i have found mload to upload big data, now i have question, is there option to use cmd ( win7 ) to export data from teradata to xxx.txt </p>
  
  <pre><code>--- sample
  select a.data1,b.data2,a.data3 from room1.REPORT_DAILY a
  inner join room1.andaikan_saja b
  on a.likeme=b.data2
  where revenue=30000
  and content_id like '%super%'
  and a.trx_date &gt;= 01/12/2015
  ;
  </code></pre>
  
  <p>this is my mload up.txt</p>
  
  <pre><code>.LOGMECH LDAP;
  .LOGON xx.xx.xx.xx/username,mypassword;
  .LOGTABLE mydatabase.LOG_my_table;
  SET QUERY_BAND = 'ApplicationName=TD-Subscriber-RechargeLoad; Version=01.00.00.00;' FOR SESSION;
  
  .BEGIN IMPORT MLOAD
    TABLES mydatabase.my_table
    WORKTABLES mydatabase.WT_my_table
    ERRORTABLES mydatabase.ET_my_table mydatabase.UV_my_table;
  
  .LAYOUT LAYOUT_DATA INDICATORS;
  .FIELD number * VARCHAR(20);
  
  .DML LABEL DML_INSERT;
  INSERT INTO mydatabase.my_table
  (               
  number =:number
  );
  
  .IMPORT INFILE "D:\folderdata\data.txt"
    LAYOUT LAYOUT_DATA
    FORMAT VARTEXT
    APPLY DML_INSERT;
  
  .END MLOAD;
  .LOGOFF &amp;SYSRC;
  </code></pre>
  
  <p>i need solution to export file to my laptop, just like my script that i put ---sample title ....
  i use that script from teradasql, and i am search for cmd script</p>