Skip to main content

COPY WITH SOURCE + LOCAL

  • August 31, 2018
  • 3 replies
  • 0 views

ShaunS

I run a command like this with no issues:
COPY
{table}
WITH SOURCE STV_ShpSource(file='{server path to file}')
PARSER STV_ShpParser();

Is there a way to run a similar command pulling the file from my local PC? I'm aware that COPY LOCAL works, but it does not seem to work in this 'file' parameter. Here's what I'm trying:
COPY
{table}
LOCAL
WITH SOURCE STV_ShpSource(file='{local PC path to file}')
PARSER STV_ShpParser();

Thanks in advance!

3 replies

Ariel_Cary
Forum|alt.badge.img
  • Participating Frequently
  • August 31, 2018

The shapefile needs to be accessible from the database node where you are running the COPY command. So, you'd first need to copy your local file to a file system accessible by the Vertica node.


ShaunS
  • Author
  • New Participant
  • August 31, 2018

Thanks, that's what I figured. Is there a SQL command to upload a file to the node, or would that strictly be a DBA function through admin console?


Ariel_Cary
Forum|alt.badge.img
  • Participating Frequently
  • August 31, 2018

Your OS admin generally would give you a user with privileges to upload files into a directory accessible by the Vertica node.