Can you call a Netezza stored procedure more than once in Select?
<p>I created a simple stored procedure for testing purposes in Netezza that returns a string. When I call it from a select statement, it works fine, unless I call it more than once on multiple columns. I get the error:</p>

<blockquote>
  <p>ERROR [HY000] ERROR:  Can't use a stored procedure in this context.</p>
</blockquote>

<p>Is this not allowed?</p>

<p>Stored procedure:</p>

<pre><code>CREATE OR REPLACE PROCEDURE SP_TEST_PROC(VARCHAR(ANY))
RETURNS VARCHAR(32)
EXECUTE AS OWNER
LANGUAGE NZPLSQL AS
BEGIN_PROC
DECLARE
    TEST_PAR ALIAS FOR $1;

BEGIN

RETURN 'A' || TEST_PAR;

END;
END_PROC;
</code></pre>

<p>How I call it:</p>

<pre><code>SELECT SP_TEST_PROC('abc') as test1, sp_test_proc('def') as test2
</code></pre>