I am not sure what I am doing wrong here .. this is not my area of expertise. Essentially I need to have a file run based on a trigger from an event in SQL, for other things like this, we have called a simple java program to do things like run a copy command.
For this, I need to execute commands inside a text file
I am getting the error
Error: java.sql.SQLException: [Vertica][VJDBC](100081) ERROR: Syntax error at or near "\"
when running this
boolean result= stmt.execute ("\\i /home/dbadmin/text.txt;");
basically I want to execute ( I have // instead of / because it is apparantly an escape character)
\i /home/dbadmin/text.txt;
Any help would be appreciated
Thanks
Syntax question /i and java/Vertica JDBC
Moderator: NorbertKrupa
Re: Syntax question /i and java/Vertica JDBC
Hi!
It's inner vsql syntax (meta command). There are no JDBC API - "export to file", you have write file via Java IO interface (OutputStream ...)
It's inner vsql syntax (meta command). There are no JDBC API - "export to file", you have write file via Java IO interface (OutputStream ...)
Re: Syntax question /i and java/Vertica JDBC
Thanks for the reply .... to read the file in, I should just need to change outputstream to inputstream?
Re: Syntax question /i and java/Vertica JDBC
Not exactly, but close... it always preferable to use in buffers.
http://www.mkyong.com/java/how-to-read- ... r-example/
http://www.mkyong.com/java/how-to-read- ... r-example/