>thanks, I better change my code.
>
>I also have another code:
>SELECT * FROM MyTable ;
> INTO CURSOR abcdzzz
>select abcdzzz
>just wonder if it's a right code.
Hi Jerry,
Why syntactically it's correct code, there're couple things to note.
First, you don't need to select a cursor after SELECT INTO CURSOR because it'll be the currently selected alias anyway. But it doesn't hurt do to that either.
Second, a query may create so called "filtered cursor". A filtered cursor is a query source table opened similar to USE AGAIN and SET FILTER applied to it. With many records returned, SET FILTER will be faster becuse records don't have to be written to the result cursor. It can be created under following conditions:
- Only one table is referenced by query
- WHERE condition is fully optimisable and can be represented by SET FILTER TO
- Either all fileds from the table are selected or subset of fields can be limited by SET FIELDS command
Such cursor cannot be used in subsequent queries and there some other sideeffects also, like RECNO().
Your query satisfies requirement for the filtered cursor. If you want query to create "real" cursor, add NOFILTER clause. If resulting cursor has to be updatable, add READWRITE clause.
--sb--