Re: [PHP-DEV] patch: odbc_execute with output parameters From: Andreas Karajannis (karajannis <email protected>)
Date: 04/07/00

Kees van Veen wrote:
>
> Hi,
>
> Here's the description of the attached patch:
> if odbc_execute() is called with an array by reference then the output
> parameters are
> copied back into the array, if not, the old (current) situation applies.
>
> Currently the way the array parameter is specified (by value of by reference) is
> not tested and odbc_execute() works both ways. The patch tests how
> odbc_execute() is called, and after execution copies the temporary array back
> into the parameter array.
>
> I've tested it both on Linux and MS-Windows and it seems to work, although I'm
> not too sure about the call to 'pval_copy_constructor' and memory allocation,
> etc. It seems to copy the entire array, but I don't know anything about PHP
> internals, so maybe one of you gurus could enlighten me on this.
>

Thanks for your patch, but are you shure it works? I've set the
parameters to be input only in SQLBindParameter(), but it wouldn't
surprise me if some drivers silently ignore this flag. Aren't you
getting Segmentation violations when the driver tries to copy values
back, since you probably didn't allocate storage space?
Another potential problem would arise if any of the output parameters
are LOBs, as those would have to be fetched in chunks.

-Andreas

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
For additional commands, e-mail: php-dev-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>