Err when calling script through external procedure

Moderator: NorbertKrupa

Post Reply
rajaduraibanu
Newbie
Newbie
Posts: 19
Joined: Thu Aug 08, 2013 8:01 am

Err when calling script through external procedure

Post by rajaduraibanu » Tue Sep 17, 2013 5:57 am

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 .

User avatar
nnani
Master
Master
Posts: 302
Joined: Fri Apr 13, 2012 6:28 am
Contact:

Re: Err when calling script through external procedure

Post by nnani » Tue Sep 17, 2013 7:12 am

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.. :)
nnani........
Long way to go

You can check out my blogs at vertica-howto

rajaduraibanu
Newbie
Newbie
Posts: 19
Joined: Thu Aug 08, 2013 8:01 am

Re: Err when calling script through external procedure

Post by rajaduraibanu » Tue Sep 17, 2013 7:46 am

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 .

rajaduraibanu
Newbie
Newbie
Posts: 19
Joined: Thu Aug 08, 2013 8:01 am

Re: Err when calling script through external procedure

Post by rajaduraibanu » Tue Sep 17, 2013 10:00 am

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 :(

rajaduraibanu
Newbie
Newbie
Posts: 19
Joined: Thu Aug 08, 2013 8:01 am

Re: Err when calling script through external procedure

Post by rajaduraibanu » Wed Sep 18, 2013 10:59 am

hi
I got the solution , Need to specify commit also in the query ...
Now everything is working fine :)

Post Reply

Return to “Vertica External Procedures”