I am trying to use dynamic temp table in dynamic dataset and have come across before-table which can easily be defined for static temp table. BEFORE-TABLE attribute of temp table handle is read only. So can this be done when dynamic tables are in use?
I had a quick look at this myself, but there doesn't seem to be a way.
I've not found any keywords that will help with the CREATE TEMP-TABLE statement.
I also tried using COPY-TEMP-TABLE to copy a static temp-table that has a before table (my idea being that we could CLEAR the temp-table and create the fields & indecies we need), but the COPY-TEMP-TABLE didn't create the before table.
I haven't found any references on PSDN or in the Knowledge Centre either.
I guess that leaves us with the possibility of contacting Technical Support and I'm guessing they'll say that it's an enhancement request and should be logged in the Enhancement Request System. I did actually check there already, but I didn't find anything.
The first time you set TRACKING-CHANGES to true on a dynamic temp-table, the runtime will create a before-table for you. And it won't go away anymore
There is also a property you can set on the .Net side to enable the before-table... SetBImageFlag.
Theo just beat me to it, but I will add that the name of the dynamic BEFORE-TABLE you get when you turn TRACKING-CHANGES on is BI. Does anyone have a pressing need to be able to set the name or create the before-table in some other way?
Excellent, thanks to all.
Does anyone
have a pressing need to be able to set the name or
create the before-table in some other way?
The confusing part for the developer is the fact you have to define the before-table in a static temp-table definition and you don't for a dynamic definition. I prefer the latter: it's the runtime managing this table in the background. I guess the explicit before-table phrase on the static temp-table definition is a way to avoid buffer conflicts in existing code, right?
This issue is a typical case of documentation failure: all individual features are documented, but there is no crossreference in the reference doc from the BUFFER-TABLE-property to the dynamic- and static definition behavior.
The confusing part for the developer is the fact you
have to define the before-table in a static
temp-table definition and you don't for a dynamic
definition. I prefer the latter: it's the runtime
Sorry, I should have formulated my original question better and instead of saying "How to define..." I should have said: "How to create...".
I knew that one does not "define" anything for dynamic objects (except their handles) so it was not the confusing part. I was intuitively looking for an attribute or a method of the dynamic table that would allow me to set the before table. Confusing part is that one has to just switch tracking changes and the system handles before tables "automagically". I believe that inconsistency in the way ABL deals with static and dynamic tables is confusing.
managing this table in the background. I guess the
explicit before-table phrase on the static temp-table
definition is a way to avoid buffer conflicts in
existing code, right?
This issue is a typical case of documentation
failure: all individual features are documented, but
there is no crossreference in the reference doc from
the BUFFER-TABLE-property to the dynamic- and static
definition behavior.
As far as documentation, yes perhaps it could be improved but I am firm believer in one of the principles outlined in "Framework Design Guidelines" by Abrams and Cwalina: well designed frameworks are consistent.
If ABL was consistent, this whole thread would not have happened.