Subject | Re: [firebird-support] Re: Inserting 100's of thousands from a SP |
---|---|
Author | Jason Dodson |
Post date | 2005-07-11T20:26:14Z |
I will give you a perfect example of wanting to do a Commit within a
stored procedure. Currently, I have a messload of stored procedures that
work like function calls, in that, they do a bunch of wacky stuff,
INCLUDING insert values into a table, and if it succeeds, it returns the
new records unique ID in a single field called "result", and "result" is
null if something went wrong. The problem is, being that it is fired in
a select statement, the inserts just dangle. Fortunately, the Easysoft
ODBC driver has an explicit option to "Commit on Select", but if this
didn't exist, without a commit within a stored procedure, this wouldnt
work out too well.
Jason
Clay Shannon wrote:
stored procedure. Currently, I have a messload of stored procedures that
work like function calls, in that, they do a bunch of wacky stuff,
INCLUDING insert values into a table, and if it succeeds, it returns the
new records unique ID in a single field called "result", and "result" is
null if something went wrong. The problem is, being that it is fired in
a select statement, the inserts just dangle. Fortunately, the Easysoft
ODBC driver has an explicit option to "Commit on Select", but if this
didn't exist, without a commit within a stored procedure, this wouldnt
work out too well.
Jason
Clay Shannon wrote:
>>>Please note the word INSIDE in my post. SQL Server allow you to do a
>
> commit INSIDE a stored procedure. In your example you are using it
> OUTSIDE the stored procedure.
>
> What we are talking about is something like this:
>
> create procedure somename as
> begin
> insert into sometable (<somefields>) values (<somevalues>);
> commit;
> end>>
>
>>I could live without beer and filet mignon and chocolate, too, but I
>
> prefer
>
>>not to.
>
>
> As you can see, you actually live without it.
> You just didn't know.
>
> I agree, then: I don't see any value to that feature (the ability to call
> commit from WITHIN a stored proc's code). I want to have programmatic
> control of whether the stored proc commits or not, based on whether any
> errors were encountered.
>
> I don't miss having no lima beans in my fridge.
>
> Clay Shannon,
> Dimension 4 Software
>
>
>
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Visit http://firebird.sourceforge.net and click the Resources item
> on the main (top) menu. Try Knowledgebase and FAQ links !
>
> Also search the knowledgebases at http://www.ibphoenix.com
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
>