I just came across a problem that I first encountered a couple of years ago. I openned a table, ran a SQL query against that table into a cursor, then re-selected the original table and attempted to pack it. Guess what. Pack failed because table is open in more than one work area. After several minutes of confusion, I did a display status and it was then very clear. Check out the example below.
SELE 0
USE FACILITY EXCLUSIVE
...
SELECT FAC_ID, FAC_NAME ;
FROM FACILITY ;
WHERE FAC_ID="001";
INTO CURSOR TEMP
...
SELE FACILITY
..
PACK
DISPLAY STATUS
I found my way out of this box before by using SYS(3) to generate a temporary table name and/or closing the cursor before executing my PACK. Additionally I found creating a self-join within the SQL statement will force the creation of a cursor instead of a filter. Well this is just a FYI/reminder.
Steve Medvid
Systems Analyst
Environmental Resource Management