Shared Temp Tables and Dataset

B.Dauvissat

New Member
Hi,

I have to modify a screen. It is composed af a window and an OCX for three tabs.

On each tab, there is a different window, each containing fill-ins, combos, etc...

All datas displayed are from a database but not directly. In fact, the main window declares six new shared temp tables and each "tab window" uses the ones it needs.

Each temp table is exactly the same as the database table with a code field added. Each line is present twice. One with a code "N" (new) and one with a code "A" (ancien, old in french). It acts like the before and after tables but into a single one.

This is how the screen was given to me.

I am asked to use a dataset instead of checking manually changes between old and new lines.

But, I can't define a temp table like this :
Code:
DEFINE NEW SHARED TEMP-TABLE myTable LIKE dbTable BEFORE-TABLE myTableBefore.
It doesn't compile.

How can I modify my screens in the most simple way ?

Thanks for your help.

Benjamin
 
Before-table is not supported on shared temp-tables.


If you can, make it a local temp-table and pass it by-reference to the programs where the temp-table is defined shared.
 
Before-table is not supported on shared temp-tables.

As far as it doesn't compile, I figured it out. ;)

If you can, make it a local temp-table and pass it by-reference to the programs where the temp-table is defined shared.

As I was waiting for an answer, I tried different things, with the help of OpenEdge documentation.

So, I tried to create a dataset.

It is an input paramter to the viewer and I can access data with stuff like that :
Code:
        ghBuffer = ghDataSet:GET-BUFFER-HANDLE("ttTable").
        ghBuffer:FIND-BY-ROWID(lxRwd).
Where lxRwd is the result of a function giving the rowid of the record I'm working with.

After that, modified datas are visible from the window with a simple FOR EACH on the Temp-Table.

So, I attach a data source to the temp table, put the TRACKING-CHANGES attribute to FALSE et try to save changes in the database.

For this, I use what's in the doc :

Code:
        FOR EACH beforeTable:
            BUFFER beforeTable:SAVE-ROW-CHANGES().
        END.

And then, the coup de théatre : an error message indicates that the table has been modified by another user (as far as I know, I work alone on this). Error code : 11913. BUT ! The modifications I made are registered in the database, despite of the message.

Now this is what is bugging me.

If anybody has an idea, I welcome it.
 
This is an excellent example of when one should step back from the existing program a bit and think about how one should write it correctly. The shared temp-table was not the right approach to start with and is certainly not an approach one would use in modern development. Trying to just cobble that over into a PDS without dealing with the structural issue is likely to be frustrating. I would suggest that you start by creating a super procedure to contain the PDS and to provide it with IPs to access the data you need for each screen.
 
Back
Top