Temp Table question

vexiteer

New Member
Progress 9.1D
Appbuilder

I think I just need to be pointed in the right direction. I have user input fields in a progress window that I would like to assign the screen value of the input fields into a temp table. Then would like to be able to display the temp table via a browse. Then I would like to copy the buffer of the temp table into final table. Is this approach the correct or am I missing something here.

Thanks for viewing my post. Any comment will be greatly appreciated.
 

walkeryan

Member
Yes, this is very common with a lot of developers but it gets a little complicated because the browser needs to be a free form query. Unless your user is going to be changing a lot of fields repeatedly I would just assign the values to the table when you write them and skip the whole temp table. but if you can't here is how you would approach the temp table.
In your definitions section:
DEFINE TEMP-TABLE tempTheTable like theTable.

(This is all pseudo code so you'll have to look up the exact syntax because its been a while since I've done this, but this will create your temp-table and give it the same fields as your final table.)

Then just assign your fields as you normally would only using the temp-table name. You can also use EXCEPT and define your own fields after that, See Progress HELP.

Once your happy with your fields and your user is done editing them just use BUFFER-COPY from your temp table to the Database table and your done.

Also to view in the browser, a quick and easy way to use it to look at your temp tables without writing your own query:

Create the browser, use the tables and fields of the table you will be copying to finally at the end of your editing, once you finish your browser, re-open it, and change it to a free form query and just go through and change all the table names to mimic your temp-tables.

Hope this helps!
 

vexiteer

New Member
I created my browse and used the freeform query. I assigned my screen-values to their temp fields they need to go into. I get the error
no table-name record is available (91).

I put in a Create table before my assign statements. Not sure what I am doing wrong here.
 

walkeryan

Member
Make sure your Temp table is being created Before your browser is loaded. Uncheck the "Open the query" checkbox in the browser setting, then create a procedure that reopens the query for your browser, make sure you create your temp tables then open the query for the browser.
 

vexiteer

New Member
I have the query piece working however none of my data is getting into the temp table.

I should be creating the temp table then running the procedure for the query. Is my hangup due to the fact I am trying to assign my screen-values to the temporay table. I tried assigning the screen values to variables then assigning them to the temporary table. But this didn't work.
 

walkeryan

Member
Either way should work just make sure you run your reload browser procedure anything you add or make changes to the temp tables information. It will not update on its own, you have to tell it to.
Pseudo Code:
Program Start.
Enter data in screen objects (combo boxes, editors, etc.)
Save to temp table.
run reload browser.
Browser should now display the data.
 
Top