Subject Re: [Firebird-Architect] Autonomous Transaction Routines
Author Vlad Khorsun
> Vlad Khorsun escreveu:
> >> 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.

Not sure, but...

> 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 a
> current valid syntax for compound statement. :-)

Yes. From the user point of view BEGIN ... END is a block of code.
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