Question about running multiple sql scripts

Disclaimer:  I'm new to Vertica.  

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

i.e. 

runVSQL.sh:

<code>

#/bin/sh

vsql -f FILELIST.sql

</code>

 

FILENAME contains a list of other SQL scripts to run. 

i.e.

FILELIST.sql:

<code>

\i insert.sql

</code>

 

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

i.e. 

insert.sql:

<code>

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

</code>

 

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.

TIA

 

Comments

  • 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
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file