Using OCI, can I retrieve multiple values from DELETE/UPDATE RETU RNING?
| From: | Ford, Mike [LSS] | Date: | Wed, 01 May 2002 11:35:48 +0000 |
| Subject: | Using OCI, can I retrieve multiple values from DELETE/UPDATE RETU RNING? | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-18921@lists.php.net to get a copy of this message | ||
Using the Oracle OCI interface, as far as I can see if I do the following:
$stmt = OCIParse($conn, 'DELETE FROM TITLES'
. ' WHERE TAG<0'
. ' RETURNING ID INTO :T_ID');
there seems to be no way of picking up more than one ID when multiple rows are deleted. The obvious
OCIBindByName($stmt, ':T_ID', $t_id, 10);
only returns one ID, and not an array of IDs as I might have expected. No other method I can think
of is able to return even that! (Including any OCIFetch variation, which doesn't surprise me
as they're labelled as being for SELECT results only!)
I would be very grateful for any suggestions of how to do this, or confirmation that it can't
be done (in which case I'll submit a Feature/Change request to ask for it!).
It seems ridiculous that I should have to do a SELECT/DELETE pair, when Oracle provides such a
useful feature to get the same result in a single statement.
Cheers!
Mike
----------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Beckett Park
Tel: extn 4730 Fax: extn 3211