Subject | Re: [firebird-php] SPs Docs |
---|---|
Author | Milan Babuskov |
Post date | 2004-11-17T12:47:08Z |
Nigel Weeks wrote:
LOT, but there are situations where I want something to be atomic (for
example looging each call to some selectable procedure) and error-prone
when done from application (someone selecting from the same procedure
from SQL editor without having it logged).
selectable stored procedure or a select to return *anything*. Selectable
SP is out of the question. To insert records you need DML-SP which
cannot be selected from or joined with a table, so you can't go with
select either.
--
Milan Babuskov
http://fbexport.sourceforge.net
http://www.flamerobin.org
> Yes, normal usage is a single transaction, but it's not always the case.Interesting.
>
> The other problem is that the 'Firebird Elite' have frowned upon
> the practice of using a 'Selectable Procedure' to do both:I don't see why would it be The Right Way (TM) or not. I don't use it A
> A DML operation (Insert/Update/Delete), and
> A return of a record set(via the suspend)
>
> Sure, it's possible, and I like using Procs in this way A LOT!!, but I've
> heard
> it's just not the right way to do it...
LOT, but there are situations where I want something to be atomic (for
example looging each call to some selectable procedure) and error-prone
when done from application (someone selecting from the same procedure
from SQL editor without having it logged).
> Summary of Challenge: Insert a row, and return the new generator-seeded IDIt just can't be done (at least in current FB versions). You need either
> in ONE COMMAND/ONE QUERY from PHP, without using a selectable stored
> procedure to do it...
selectable stored procedure or a select to return *anything*. Selectable
SP is out of the question. To insert records you need DML-SP which
cannot be selected from or joined with a table, so you can't go with
select either.
--
Milan Babuskov
http://fbexport.sourceforge.net
http://www.flamerobin.org