title: Connecting R To Teradata VOLATILE TABLE
body: <p>I am using R to try and connect to a teradata database and am running into difficulties
  The steps in the process are below</p>
  
  <p>1)  Create Connection
  2)  Create a VOLATILE TABLE
  3)  Load information from a data frame into the Volatile table</p>
  
  <p>Here is where it fails, giving me an error message</p>
  
  <p><strong>Error in sqlSave(conn, mydata, tablename = "TEMP", rownames = FALSE,  : 
    first argument is not an open RODBC channel</strong></p>
  
  <p>The code is below</p>
  
  <pre><code># Import Data From Text File and remove duplicates
  mydata = read.table("Keys.txt")
  mydata.unique = unique(mydata)
  
  strSQL.TempTable = "CREATE VOLATILE TABLE TEMP………[Table Details]"
      "UNIQUE PRIMARY INDEX(index)"
      "ON COMMIT PRESERVE ROWS;"
  
   # Connect To Database
     conn &lt;- tdConnect('Teradata')
  
   # Execute Temp Table
     tdQuery(strSQL.TempTable)
     sqlSave(conn, mydata, tablename = "TEMP ",rownames = FALSE, append = TRUE)
  </code></pre>
  
  <p>Can anyone help, Is it closing off the connection before I can upload the information into the Table?</p>