Subject Re: [firebird-support] Multiple select inside procedures and PHP???
Author Helen Borrie
At 06:29 PM 1/05/2005 +0200, you wrote:
>Thank you Helen.
>
>Any chance of getting a stack owerflow using the 'for do'?
>
>The procedure works just perfect by itself.
>
>I'm working with PHP5, odbc-driver 2.0 for Firebird 1.5
>This is a part of the PHP-code:
>
>$FirmaQuery = "Select ID_KATEGORI, KATEGORI, ID_LEVERANDOR, LEVERANDOR, ";
>$FirmaQuery .= "URL, KALKURL ";
>$FirmaQuery .= "from view_presentasjon ";

***************************************************************

>$FirmaQuery .= "where Kategori like '$useKategori' ";

***************************************************************

>$FirmaQuery2 = "EXECUTE PROCEDURE SEL_PROC_V_PRESENTASJON ('$useKategori')";
>
>$Result = odbc_do($Connection, $FirmaQuery); /***** Gives all wanted rows ***/
>
>$Result = odbc_do($Connection, $FirmaQuery2); /***** Gives 1 row random ****/
>
>Does anybody really know why?

I think the above clause should not be there, since I think your
procedure's output loop is this:
...
AS
BEGIN
FOR select ID_KATEGORI, KATEGORI, ID_LEVERANDOR,
LEVERANDOR, URL, KALKURL
from view_presentasjon
where kategori CONTAINING :in_kat
order by kategori into
:V_ID_KATEGORI, :V_KATEGORI, :V_ID_LEVERANDOR,
:V_LEVERANDOR, :V_URL,:V_KALKURL
DO
suspend;
END

As for the stack overflow, I can't comment about where that came from. I
don't know what causes stack overflows in PHP5. Ask on firebird-php...

./heLen