On 9/17/06, M <[EMAIL PROTECTED]> wrote:
> 1- $this->model->begin();
> 2- $result = $this->model->save();
> 3- $sql = 'call myprocedure()';
> 4- $this->model->execute( $sql );
> 5 -$this->model->commit();
>
> How can I structure the code to make the statements 2 and 4 atomic? I
> know I can test the return code for statement 2, but I don't know how
> to do it with statement 4.

The API states that execute() returns an array, but the stored
procedure might not return anything and still be okay. I don't know
what error will be returned by the database server. Maybe you have to
manually check for db errors and abort, depending on the result.

The code to manually check for db errors is regularly posted here,
search for "nate" and "getdatasource" and you should be fine.

-- 
  Martin Schapendonk, [EMAIL PROTECTED]

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---

Reply via email to