Discussion:
[Firebird-docs] LangRef 2.5beta1 - a few more suggestions /5
Aage Johansen
2016-04-10 18:23:52 UTC
Permalink
I'll have mostly non-Firebird things on my mind the next week, so I'm
just unloading my latest comments now!

==============================================
p.117
Add a sentence to make it clear when the trigger is fired:
For mutation events, does the trigger fire at commit or at individual
insert/update/delete.
For two-phase-commit, it is described at p.122 (good!).

p.119:
"Declarations and embedded statements are terminated with semi-colons (;)."

For statements with a begin...end block, no semi-colon is used.
----------------------------------------

Simple "if":
BEGIN
IF (NEW.cust_no IS NULL) THEN
NEW.cust_no = GEN_ID(cust_no_gen, 1);
END

But, with a block of statements:
BEGIN
IF (NEW.cust_no IS NULL) THEN
BEGIN
NEW.cust_no = GEN_ID(cust_no_gen, 1);
END
END

p.248 reveals that
"The BEGIN and END statements have no line terminators."
This explains it, but:
a)
This is a trap for new users - please make a note around p.119 (about
semi-colons).
b)
"line terminators"? "statement terminator" seems better.

And "embedded statements" - are these just ordinary statements in the trigger?

----------------------------------------

p.124
ALTER TRIGGER set_cust_no INACTIVE;

Does this have immediate effect, even without a commit?
If a user inactivates a trigger, does something and then activates
the trigger - what is
the effect for users (in the inactive periode)? And, is it really
inactive (without a commit)?
I believe there has been some confused/confusing discussions on the
support list in the past on whether
a user can have a trigger de-activated just for himself. (He cannot, IIRC)

==============================================
--
Aage J.
Helen Borrie
2016-04-10 21:39:53 UTC
Permalink
Hello Aage,
Post by Aage Johansen
I'll have mostly non-Firebird things on my mind the next week, so I'm
just unloading my latest comments now!
Hope it goes well for you Aage!
I'm not ignoring your suggestions, just a bit swamped at the moment
with customer work and Fb 3 release.

Thanks again!

Kia ora,
Helen

Loading...