Subject Newbie: SP isc_dsql_prepare failed
Author Bhavbhuti Nathwani
Hi all

I have another SP gearing towards what I intend to return from SP. I
want to use it in a SELECT as follows:

SELECT mAccounts.*, NarrAcctOpBal2.mNarration
FROM mAccounts
JOIN NARRACCTOPBAL2(mAccounts.iID) on NarrAcctOpBal2.iID =
mAccounts.iID

My SP which errors and cannot be created is as follows:
SET TERM ^ ;
CREATE PROCEDURE NARRACCTOPBAL2 (
IID Integer )
RETURNS (
LIID Integer,
LMNARRATION Varchar(32000) )
AS
BEGIN
SELECT mAccounts.iID as liID, 'Opening Balance' AS lmNarration
FROM MACCOUNTS
where maccounts.iID = :iID;
END^
SET TERM ; ^

Please advise and thanks for bearing with my newbie queries.

Regards
Bhavbhuti