Hi,
I have created a file say testquery and when I am running this executable file ./testquery , it is executing perfectly , that is connecting to database and inserting a new record.However, when I am scheduling the same file using cron job it is failing with the error msg : vsql command not found.
Following is the two lines of code in that file (testquery):
cd /opt/vertica/bin/
vsql -d dbname -c "insert into testtable values(100,'aaa',200);commit;" -U dbadmin -w test
Plz help me in resolving this issue.
Thanks
martyn
How to schedule vsql command from cron job ?
Moderator: NorbertKrupa
-
- Newbie
- Posts: 2
- Joined: Thu Apr 03, 2014 1:51 pm
- JimKnicely
- Site Admin
- Posts: 1825
- Joined: Sat Jan 21, 2012 4:58 am
- Contact:
Re: How to schedule vsql command from cron job ?
Instead of changing the directory, can you use the full path to vsql like this?
/opt/vertica/bin/vsql -d dbname -c "insert into testtable values(100,'aaa',200);commit;" -U dbadmin -w test
/opt/vertica/bin/vsql -d dbname -c "insert into testtable values(100,'aaa',200);commit;" -U dbadmin -w test
Jim Knicely
Note: I work for Vertica. My views, opinions, and thoughts expressed here do not represent those of my employer.
Note: I work for Vertica. My views, opinions, and thoughts expressed here do not represent those of my employer.
-
- Newbie
- Posts: 2
- Joined: Thu Apr 03, 2014 1:51 pm
Re: How to schedule vsql command from cron job ?
Thanks a ton "knicely87", it worked.
Thanks again
Martyn
Thanks again
Martyn