Re: [PHP] Stored procs and transactions using Linux/PHP and Windows/MSSQL



Quoting Richard Lynch <ceo@xxxxxxxxx>:

On Wed, September 27, 2006 7:40 am, Rick Emery wrote:
I'm trying to do something like this in the PHP application:

begin transaction
execute a stored procedure, receiving an identity back
if certain conditions are met
execute another stored procedure, getting an identity
if certain other conditions are met
execute another stored procedure, getting an identity
if any of the above procedures fail
rollback transaction
else
commit transaction

I ran into some problems using both PDO and the mssql_* functions (if
someone is successful using one of these, I'll likely be asking in a
future message for help with the problems I'm encountering).

You have to describe your problems to get useful help.

True. In this message, I was looking for people who had done what I was attempting in order to solicit advice. But recognizing that I may not find anybody, I guess I should try to find some help with the specific problems.

With PDO, I use the dblib driver (which is the driver that all of the documentation I can find says to use). Unfortunately, the dblib driver does not support transactions; I've filed an enhancement request.

With the mssql functions, the first problem was that the "bigint" data type is not supported. I coded around that (by using "varchar" and converting it in the stored procedure), but now I get:

Warning: mssql_query() [function.mssql-query]: Query failed in /var/www/html/business/entity.php on line 127

which is:
mssql_query('RollBack Transaction');

but can't get any information about why it failed. Running the same commands in Query Analyzer works without error.

I'm just asking to see if anyone is successfully doing what I'm trying
to do, and if so, what method is being used to accomplish it.

The probability that *nobody* from the millions of PHP users and the
millions of MS SQL users is doing this is pretty much 0.

Agreed. I just need to somehow find the successful one(s) :-)

Thanks,
Rick
.



Relevant Pages

  • Re: [PHP] Stored procs and transactions using Linux/PHP and Windows/MSSQL
    ... begin transaction ... execute a stored procedure, receiving an identity back ... The probability that *nobody* from the millions of PHP users and the ...
    (php.general)
  • Stored procs and transactions using Linux/PHP and Windows/MSSQL
    ... Is anyone using PHP5 on Linux to connect to MS SQL Server 2000 on Windows and execute stored procedures with output parameters within a transaction? ... execute a stored procedure, receiving an identity back ... I ran into some problems using both PDO and the mssql_* functions (if someone is successful using one of these, I'll likely be asking in a future message for help with the problems I'm encountering). ...
    (php.general)
  • Re: [PHP] Stored procs and transactions using Linux/PHP and Windows/MSSQL
    ... Windows and execute stored procedures with output parameters within a transaction? ... I'm trying to do something like this in the PHP application: ... execute a stored procedure, receiving an identity back ...
    (php.general)
  • Re: Basic Question Re Quantities
    ... > It would be best to do this in a stored procedure. ... > it is one transaction, so you don't need to worry abvout locking rows, SQL ... declare @qty int ... Then two session can each execute the select, ...
    (microsoft.public.sqlserver.programming)
  • Re: transaction with unknown nbr of commands
    ... then call your wrapper stored procedure, passing it all of the user ... explicit transaction with a BEGIN TRAN statement, ... >When I run a sqlcommand in a transaction, ...
    (microsoft.public.dotnet.framework.adonet)