Page 1 of 1

Err when calling script through external procedure

Posted: Tue Sep 17, 2013 5:57 am
by rajaduraibanu
HI
My procedure is as below
#!/bin/bash

us="dbadmin"
pw="tdadb"
PORT=5433

VSQL="/opt/vertica/bin/vsql"
myvsql="$VSQL -A $us $pw -c "

$myvsql "
select * from table;
" >> /opt/etl/etc/files/selectop 2>&1
exit 0
-------------------------------------------------------------
If i execute the script m getting proper op
my procedure is
create procedure test() as 'test.sh' LANGUAGE 'external' USER 'dbadmin';
CREATE PROCEDURE

but When i call it through procedure my err is as below
INFO 4427: Procedure reported:
Could not execute procedure, errno=8
ERROR 4424: Procedure execution error: exit status=1

How to print the outputs ?

Please help me .

Re: Err when calling script through external procedure

Posted: Tue Sep 17, 2013 7:12 am
by nnani
Hello rajaduraibanu ,

Vertica Documentation says
Handling Procedure Output
Vertica does not provide a facility for handling procedure output. Therefore, you must make your own arrangements for handling procedure output, which should include writing error, logging, and program information directly to files that you manage.
Please refer to this post for your query
http://www.vertica-forums.com/viewtopic.php?f=76&t=1140

Hope this helps.. :)

Re: Err when calling script through external procedure

Posted: Tue Sep 17, 2013 7:46 am
by rajaduraibanu
No actuaaly i don need to print or see ma output , But for insert operation it shuld insert a row right .
That is not happening .

Re: Err when calling script through external procedure

Posted: Tue Sep 17, 2013 10:00 am
by rajaduraibanu
Now m able to select values and write into file and Create table too .. But Not able to do insert , update and delete operations
. Any permission need to b given ???


when i execute procedure on db console m getting output as 0 , that mean its executed perfectly and inside file it is writing as OUTPUT
1
(1 row)
which indicates it inserted 1 row , but wen i select data , nothing is insertetd :(
Not getting wat s Hapng :(

Re: Err when calling script through external procedure

Posted: Wed Sep 18, 2013 10:59 am
by rajaduraibanu
hi
I got the solution , Need to specify commit also in the query ...
Now everything is working fine :)