Subject Re: [ib-support] Problem with FB's SP
Author Arno Brinkman
Hi,

> Hello,
>
> I have this SP:
>
> CREATE PROCEDURE GETVALUE (TblIndex Varchar(30),
> FldIndex Integer)
> returns (FldValue Varchar(255))
> AS
> declare variable counter Integer;
> begin
> counter = 0;
> for select VALORE FROM Tabella having( Select * FROM DOC_Tabella WHERE
> ID_TABELLA=:TblIndex)
> into FldValue
> counter = counter+1
> if counter < FldIndex then
> skip;
> if counter > FldIndex then
> exit;
> Suspend;
> end
>
> it doesn't recognize the Select * in the having clause.
>
> Where may the problem be?

A HAVING clause is for use with aggregate selects. Is that what you want ?
Maybe you want to use :

WHERE
EXISTS(SELECT * FROM ....)

Regards,
Arno Brinkman