The Vertica Forum recently got a makeover! Let us know what you think by filling out this short, anonymous survey.

Question about running multiple sql scripts

Disclaimer:  I'm new to Vertica.  

I have a shell script that runs a SQL script with vsql




vsql -f FILELIST.sql



FILENAME contains a list of other SQL scripts to run. 




\i insert.sql



This works fine when the SQL scripts it's running contains DDL to create schema objects i.e. CREATE table ..... 

but when I try to run DML




INSERT INTO SomeTable (something1,something2) VALUES ( somevalue1,somevalue2 );



vsql fails complaining about syntax.... Syntax error at or near "INSERT" at character 1

I'm sure it's something silly, but what am I missing?  Am I going about this all wrong?

Any input would be  great.




  • Also, just to add, If I run the insert.sql ( vsql -f insert.sql ) script directly, it works fine.. it only fails when called from another SQL script 



Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file

Can't find what you're looking for? Search the Vertica Documentation, Knowledge Base, or Blog for more information.