15.03.2022 20:14, Adriano dos Santos Fernandes wrote:
On 15/03/2022 14:02, Vlad Khorsun wrote:

SQL standard defines LOCAL TEMPORARY TABLES (LTT), which may be
"created" or "declared". The semantics of these standard specs are
different and not very easy applicable to Firebird as they are based on
standard notion of modules, that is not similar to PSQL routines.

   Could you specify, in short, what part of standard is hard to apply to
the Firebird ?


Declared LTTs are defined in "SQL-client module"

SQL-client module seems to have a relation to packages.

They can group procedures.

So as I said, declared LTTs feat well in packages.

The standard does not define LTTs inside routines.

  Yes. But we can think of "standalone" PSQL routine as of member of implicit
package, if needed.

If they did, they could have defined it with different semantics than
what I propose, for example, it could use the routine only as a scope,
but with shared data between invocations. So my reluctance in define LTT
inside routines.

  It could be discussed and I see no big problem implementing both scope's.
I.e. data of DECLARE'd LTT could shared or not for recursive invocations of
PSQL routine with declaration. Also, we should define access rules for
sub-routines.

Declared LTTs uses syntax "DECLARE LOCAL TEMPORARY TABLE <name> ... [ ON
COMMIT PRESERVE/DELETE ROWS ].

   "ON COMMIT" clause seems meaningless for LTT's DECLARED within PSQL
routine,

Does it means ON COMMIT would be prohibited there inside routines?

  Prohibited or ignored, to be decided.

while could be useful for packaged LTT's.


But LT (non-transactional) is also useful in packages.

It then means in package not using ON COMMIT would mean a different
thing than absence of ON COMMIT in GTT. Not something we would want.

  It is also should be discussed properly. BTW, why do you want LT to be
non-transactional ? Because of implementation difficulties or by another
reason ? For me, transactional LT[T] is a must have feature, while
non-transactional could be an extension.

Regards,
Vlad


Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to