Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Reminder with Cursors
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
SQL Reminder with Cursors
Miscellaneous
Thread ID:
00019327
Message ID:
00019327
Views:
77
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
Next
Reply
Map
View

Click here to load this message in the networking platform