i created simple stored procedure testing purposes in netezza returns string. when call select statement, works fine, unless call more once on multiple columns. error:
error [hy000] error: can't use stored procedure in context.
is not allowed?
stored procedure:
create or replace procedure sp_test_proc(varchar(any)) returns varchar(32) execute owner language nzplsql begin_proc declare test_par alias $1; begin return 'a' || test_par; end; end_proc;
how call it:
select sp_test_proc('abc') test1, sp_test_proc('def') test2
you cannot call more 1 stored procedure in select. there couple of ways can call netezza stored procedure:
call sp_test_proc('abc'); exec sp_test_proc('abc'); select sp_test_proc('abc');
however, cannot have clause when using select. select form synonym 1 of other forms, , not select think of one.
you can find documentation on calling stored procedure here.
if looking scalar function, better served writing udf. however, udfs in netezza not support nzplsql language. have write in 1 of supported udf languages (e.g c++ or lua).
Comments
Post a Comment