title: Join Oracle table directly to csv file
body: <p>I have script where I am trying to join data from an Oracle table to a csv file. The Oracle table is HUGE (over 1.8 million rows, which I why I am not loading the table first and then joining to the csv file, instead I am trying to do a left join directly with the csv file) and this is the code I wrote, but I am getting this error:</p>
  <p>Error in <code>left_join()</code>:
  ! Join columns must be present in data.
  ✖ Problem with <code>PARTYID</code>.
  Run <code>rlang::last_error()</code> to see where the error occurred.</p>
  <pre><code>library(odbc)
  library(DBI)
  library(rstudioapi)
  
  output &lt;- crews %&gt;% 
    clean_names() %&gt;% 
    mutate(clientid = str_remove_all(clientid, &quot;[-]&quot;)) %&gt;%
    mutate(clientid = str_squish(clientid)) %&gt;%
    inner_join(newcsv, by = &quot;clientid&quot;) %&gt;%
    left_join(party &lt;- dbGetQuery(con, &quot;SELECT PARTYID FROM CURAM.DBO.PARTY&quot;), by = c(&quot;partyid&quot;= &quot;PARTYID&quot;))  %&gt;% 
    clean_names()
  
  </code></pre>
  <p>I also tried the code this way and still getting an error:</p>
  <pre><code>output &lt;- crews %&gt;% 
    clean_names() %&gt;% 
    mutate(clientid = str_remove_all(clientid, &quot;[-]&quot;)) %&gt;%
    mutate(clientid = str_squish(clientid)) %&gt;%
    inner_join(newcsv, by = &quot;clientid&quot;) %&gt;%
    left_join(party &lt;- dbGetQuery(con, 'SELECT PARTYID AS &quot;partyid&quot; FROM CURAM.DBO.PARTY'), by = (&quot;partyid&quot;)  %&gt;% 
    clean_names()
  
  </code></pre>
  <p>If someome could help me fix this that would br great as I am sure there must be a way to directly connect Oracle table to a csv file without having to load the entire table first. Thank you!</p>