Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to read a working table

Status
Not open for further replies.

carolynh

Programmer
Feb 13, 2004
44
US
I have a program that creates a working table and I want to browse the data in these tables, but I cannot remember how to do this.
Thanks
carolyn
 
I'm not sure what you mean by a working table. Do you mean a temp-table or a workfile? If it's either of these, you can use all of the same tools and 4GL commands you would use to browse a regular table that's in the database. If you mean something else, could you please clarify? Thanks!

Rich
 
Richtpt
I mean a Work-table. It is similiar to a Temp-table, but temp tables are stored in a temporary db on disk and work table records are stored in memory. Sorry for the confusion.
 
Ah, got it. Well, the only difference between regular tables in the database schema, temp-tables, and workfiles (work-tables) is how they are stored and for how long. You access all of them the same way.

If I had a database table called Customers and wanted to list every field in that table, I could simply do:

for each customers no-lock:
display customers.
end.

You access temp-tables and workfiles the same way.

Temp-Table: Cust-Tmp

for each Cust-Tmp no-lock:
display Cust-Tmp.
end.

Workfile: Cust-Work

for each Cust-Work no-lock:
display Cust-Work.
end.

You can also use all of the other 4GL tools. You can do a FIND on them, create queries and browsers, do dynamic queries, buffer-copies, all that stuff that you can do with database tables.

And technically, temp-tables start OUT being stored in memory, but when they run out of memory, they start using disk space. Workfiles are completely stored in memory and if you run out of memory, the program will crash. Temp-Tables have other advantages too and are definitely prefered for use in all situations, mainly because you never have to worry about them getting filled up like you do with Workfiles. I've seen the problem with Workfiles first hand and was thrilled when they introduced temp-tables. :)

Hope that helps. :)

Rich
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top