Subject SP with input parameter in a SELECT statement
Author Robert
Hi,
I tried to execute next statement:

SELECT VAR1
FROM STOREDPROC(:VAR2)

But I get this prepare error:

Dynamic SQL Error
SQL error code = -206
Column unknown
VAR2

Executing the next statement gives no problem:

SELECT VAR1
FROM STOREDPROC(1)

The stored procedure is declared as (simplified, just for example):

CREATE PROCEDURE STOREDPROC(VAR2 INTEGER)
RETURNS (VAR1 INTEGER)
AS
BEGIN
VAR1 = 2*VAR2;
SUSPEND;
END

Can someone explain the error?

Using Firebird WI-V1.5.1.4481.

Thanks,
Robert.