title: r Error in sqliteExecStatement(con, statement, bind.data) : RS-DBI driver: (error in statement: no such column: csnu)
body: <p>I am new in R and i have searched for similar problem and coulnd't find an answer.sorry if cross posting please refer to correct link please. </p>
  
  <p>I have one 2 csv files. 1-Bm with 86 rows and 2 columns.   </p>
  
  <pre><code>BM &lt;- read.csv('Z:/R_CGV/alB.csv', header = FALSE)
  </code></pre>
  
  <p>2nd - BG with 80 rows and 14 columns.       </p>
  
  <pre><code>BG &lt;- read.csv('Z:/R_CGV/BG111.csv', header = FALSE) 
  </code></pre>
  
  <p>I need to go through BM file and where (BM's 1st column content equlas to 12th col in BG file)BM[,1]=BG[i,1] want to extract 2nd colums contents.    </p>
  
  <pre><code>library(sqldf)
   BM &lt;- read.csv('Z:/R_CGV/alB.csv', header = FALSE)    
   BG &lt;- read.csv('Z:/R_CGV/BG111.csv', header = FALSE) 
  
  len_BM &lt;- length(BM)
   csNu &lt;- BG[,12]
  for (i in len_BM)
  
  
  BnNam &lt;- BM[i:len_BM,1]
  {
  
      RetC_BN &lt;- read.csv.sql("alB.csv", sql="select * from BM where csNu=BnNam")
  
  }    
  </code></pre>
  
  <p>It throughs me error:</p>
  
  <pre><code>Error in sqliteExecStatement(con, statement, bind.data) : 
    RS-DBI driver: (error in statement: no such column: csNu)
  </code></pre>
  
  <p>I checked with keywords and tried to change names but nothing helps. What am I missing here?</p>
  
  <p>example of BM (../alB.csv) file:</p>
  
  <pre><code>10  3    
  23  4    
  37  3    
  # more lines
  86  5   
  </code></pre>
  
  <p>Example of BG (.../BG111.csv') file:</p>
  
  <pre><code>10  41.16   1   0.36   47   0.94    49  26.83   26.83   1 0.3249 0.63   49  26.83
  100 40.62    0  0.11    55  0.95    107 33.62   42.25   0   0.117   109 0.64    107 33.62
  # more lines
  101 29.75   0   0.082   111 0.91    107 12.62   29.75   0   0.08    111 0.88    107 12.62
  </code></pre>
  
  <p>Many thanks,
  Mil'</p>