Subject | Re: [Firebird-Architect] Autonomous Transaction Routines |
---|---|
Author | Vlad Khorsun |
Post date | 2007-11-09T14:38:10Z |
> Vlad Khorsun escreveu:Not sure, but...
> >> Alex Peshkov escreveu:
> >>
> >>> And may I suggest slightly other syntax. We never write
> >>> BEGIN FOR SELECT ...
> >>> END FOR SELECT
> >>> May be for autonomous transaction a bit more traditionally-looking syntax can
> >>> be used, i.e.:
> >>> IN AUTONOMOUS TRANSACTION DO {complex_statement}
> >>>
> >> It's current defined this way. That seems more a PSQL-like command.
> >>
> >> We can change it if there is good arguments for. ;-)
> >>
> >
> > I, personally, prefer
> >
> > BEGIN [AUTONOMOUS [<tran_options> TRANSACTION]]
> > ...
> > END
> >
> > where [<tran_options> TRANSACTION] may be implemented later
> >
> 1) A common usage pattern of autonomous transaction will be to insert
> one row in a table.
> Current syntax allow it without BEGIN ... END....and i like it :
BEGIN AUTONOMOUS
INSERT ..
END
:)
> 2) Only BEGIN ... END as you suggested (AUTONOMOUS... optional) is aYes. From the user point of view BEGIN ... END is a block of code.
> current valid syntax for compound statement. :-)
And BEGIN AUTONOMOUS ... END clearly states it is block of autonomous code
(or autonomous block of code :), i think. Also it eliminate needs for new syntax
construction
Regards,
Vlad