On 15/03/2022 14:07, Dmitry Yemanov wrote:
> 15.03.2022 17:14, Adriano dos Santos Fernandes wrote:
>>
>> As part of "Support multiple rows for DML RETURNING (#6815)" feature,
>> BLR verbs for "local table" were created.
>>
>> Local tables (LT) as defined there works outside transaction control.
>> For #6815 this does not matter, but I want to add LT feature that will
>> use these verbs.
>>
>> LTs are defined inside PSQL routines and its data is separated per
>> routine invocation. For example a recursive routine will have different
>> data in its LTs per each invocation, like local variables.
> 
> What about autonomous transactions? Will procedure's LT data be visible
> for them or every autonomous transaction gets its own copy?
> 

Like a standard variable, data will be shared with the autonomous
transaction scope.

Note that if we say that as the contrary, LT would be very similar to a
LTT (with transaction control). And that would not be problematic, but...

I also want packaged LT in the future, with would be very useful to work
outside transaction control.


>> 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.
> 
> I'd just adapt their definitions to our realities. For me, "created" LTT
> is similar to GTT (i.e. stored in the schema) but with data isolated per
> request (per PSQL routine).

My understanding is that it is per session / package (SQL-client
module), not request / routine.


> "Declared" LTTs are defined inside the PSQL routine,

Inside a package (SQL-client module) with data shared in the package /
session.


> In fact, what you priorly define as LT is IMO "declared" LTT.
> 

I had that impression before read the standard, but then I changed my
opinion.

I also did not found any major DBMS that implemented declared LTTs, nor
SQL-standard modules.


Adriano



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

Reply via email to