0

It will be Great if anyone an help me out with COPY function syntax.

I am trying to copy data from google Doc to with the help of (using and RJDBC Package).

I have exported the data from google sheet but unable to import in Vertica server.

Please Help me out.

googleSheet <- gs_title("GS", verbose = FALSE)
auditSheet  <- gs_read(ss = googleSheet, ws = 'GS1')

copy verticaDB.tableName from local auditSheet

Thanks

thothal
  • 16,690
  • 3
  • 36
  • 71
  • I would experiment with the COPY command from a file - reading the manual. Remember that you need a table already created with the structure of the data you want to import. From R - even if I'm not an expert, I would explore the `COPY . FROM STDIN` command. And I would expect that you need to create a dataframe in R. I'm not sure if you need an INSERT statement with parameter markers or if you can use `COPY ... FROM STDIN` – marcothesane Jan 03 '19 at 18:20
  • I'm not an "R" programmer - but can you export `googleSheet` or `auditSheet` to a CSV file, with ',' as the column delimiter and '"' (double quote) as the string encloser? – marcothesane Jan 07 '19 at 18:05
  • Then you could use Vertica like so: `CREATE FLEX TABLE googlesheet();` `COPY googlesheet FROM LOCAL 'yourfile.csv' PARSER FCSVPARSER();` `SELECT COMPUTE_FLEXTABLE_KEYS_AND_BUILD_VIEW('googlesheet');` .. and finally: `SELECT * FROM googlesheet_view LIMIT 10;` to see the first 10 rows in your flex table. – marcothesane Jan 07 '19 at 18:09

0 Answers0