Subject | RE: [firebird-support] Newbie: SP isc_dsql_prepare failed |
---|---|
Author | Alan McDonald |
Post date | 2007-11-22T07:57:44Z |
> Hi allI have a personal aversion to this (mAccounts.*, ) syntax. You are always
>
> 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
better to name all fields explicitly.
The join here to the SP will not provide good performance I'm afraid. Try it
and see if you're happy. (see below for changed SP). I'd probably set this
up with a view instead of an SP so the join works well.
Alan
>FOR SELECT mAccounts.iID , 'Opening Balance' FROM MACCOUNTS
> 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
where maccounts.iID = :iID into :LIID, LMNARRATION DO BEGIN
SUSPEND;
END;
> END^
> SET TERM ; ^
>
> Please advise and thanks for bearing with my newbie queries.
>
> Regards
> Bhavbhuti