Subject Re: [firebird-php] Re: Serious PHP question
Author Lester Caine
Didier Gasser-Morlay wrote:

> Can't find the source code of your SP. May be the issue lays there ?
>
> would not mind looking at it.
>
> Didier

Nigels problem from the firebird-support list

> I'm using PHP, and FirebirdSQL, and I've hit a big snag...
>
> I'm trying to use a stored procedure that requires quotes around the input
> parameters(it's a varchar, with spaces all through it)
>
> There are no examples of how to get it to go.
>
> Here's a test case:
> create table tbl_test (
> str_test VARCHAR(100)
> );
>
> set term !! ;
> create procedure sp_find (
> str_test varchar(100)
> ) returns (
> int_count INTEGER
> ) AS BEGIN
> select count(*) from tbl_test where str_test = :str_test INTO :int_count;
> suspend;
> END !!
> set term ; !!
>
> The procedure is simplified for example purposes.
>
> Now the PHP side:
> $prep = ibase_prepare("SELECT * FROM SP_FIND(?)");
> while($name = (gets set from another query - but can contain spaces)){
> $extravar = $name->STR_TEST; // Put it into another variable
> $rec = ibase_execute($prep,$extravar);
> --------if $extravar has spaces, it dies--------
>
> $rec = ibase_execute($prep,'$extravar');
> --------it dies all the time, "Value '?' unknown" -----------
>
>
> How are parameters for Stored. Procs quoted when necessary?
>
> You are the last resort...

I have not needed SP's like that myself ;)

--
Lester Caine
-----------------------------
L.S.Caine Electronic Services