title: How to write batch (*.bat) script to execute Teradata query using BTEQ?
body: <p>Below is the content of my script.bat :</p>
  
  <pre><code>@echo off
  
  cd C:\Program Files\Teradata\Client\13.0\bin
  
  bteq .LOGON server/username,password;
  
  select date;
  
  .LOGOFF
  
  @echo off goto end
  
  :end @echo exit
  </code></pre>
  
  <p>I have no problem with the logon, but it seems that bteq can't read my query statement:</p>
  
  <blockquote>
    <p>select date;</p>
  </blockquote>
  
  <p>It keeps prompting for input. Can anyone help me to get bteq to read and execute the query statement?</p>
  
  <p>I've tried the solutions online about input and output file:</p>
  
  <pre><code>bteq &lt;myscript.txt&gt; mylog.log
  </code></pre>
  
  <p>but it didn't work either.</p>