title: How to pass parameters to sql scripts via command line
body: <p>There a requirement where I am trying to  automate a process in my project where in a sql need to be run for daily reporting.</p>
  
  <p>sql looks like below: (This is simplest form but my sql is of 400 lines,below is just an example to get the results).</p>
  
  <p><strong>test.sql</strong></p>
  
  <pre><code>select * from table
  where create_date between &amp;date1 and &amp;date2;
  </code></pre>
  
  <p>I wanted to create a bat file that calls the sqlplus and passes the dates via command prompt.Date will be calculated automatically and will be passed in the commmmand prompt itself.</p>
  
  <p>I've tried the below command line :</p>
  
  <pre><code>sqlplus userid/password@db_name @test.sql DATE1 DATE2
  </code></pre>
  
  <p>But that still prompts me to enter the dates for date 1 and date 2 which I want that to be picked up from arguments automatically.</p>
  
  <p>Could you please help me in  achieving the above ?</p>