External Stored procedures issue
Hi there,
I have created a stored procedure using shell script and registered/installed the stored procedure in my Vertica database.
Shell script uses linux sqlcmd SQL Server command-line tool to run a SQL server stored procedure and update single table in SQL server.
When I execute the shell script it works fine and I see SQL Server table data updated, but when I call the stored procedure in vsql it runs fine, doesn't generate any error, but the SQL table data is not changed.
Just curious if any of you had the same issue.
Any recommendation is welcome.
Thanks,
Trajce
0
Comments
Make sure your script exits with a non-zero value when an error occurs. E.g. in bash something like this:
ls /doesnotexist || exit 1
Content that is written to stdout by your script will be reported in an INFO message sent from the server to the client (I'm not sure what the client drivers do with INFO messages but vsql prints them to the terminal). I believe stderr is redirected to a log file on the server. Therefore it might be helpful to redirect stderr to stdout when debugging your scrip:
ls /doesnotexist 2>&1 || exit 1