PRB: Cannot Modify Table Structure After Using SQL SELECTID: Q133470 The information in this article applies to:
SYMPTOMSAfter performing an SQL SELECT statement on a table, the table structure becomes read-only, so you can't modify it.
CAUSEInitially the SELECT statement is processed to see if the result set can be obtained from the original table with the application of a filter. If it can, a temporary cursor is not created on disk; instead, a filtered view of the original table is created. You will see a cursor object in the View window with the name QUERY, this is an alias of the source table. Because you are looking at a filtered view of the original table, the MODIFY STRUCTURE command won't work; the underlying table structure of the result set has been temporarily frozen.
RESOLUTIONTo execute an immediate MODIFY STRUCTURE command on the source table, you must first close the QUERY cursor. Alternatively, you could avoid this by editing the query to involve complexities that would force a temporary, physically distinct cursor to be created.
STATUSThis behavior is by design.
MORE INFORMATIONCode to Reproduce Behavior The following test code demonstrates this principle with a very simple single-table query:
The following example shows a more complex query. Consequently, Visual
FoxPro creates a cursor object named QUERY on the hard disk instead of
creating a filtered alias.
Additional reference words: 3.00 VFoxWin
KBCategory: kbtool kbprb
KBSubcategory: FxtoolRqbe
|
Last Reviewed: August 1, 1995 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |