Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Strangeness on SQL Select - help...
Message
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00161038
Message ID:
00161041
Views:
21
>Here's the scenario...
>
>I have a table (345,000 records) of transactions. The table has many fields with indexes exclusive to their own fields.
>
>One of the fields is tran_year (transaction year) which has it's own index and is not compounded with any other fields
>
>"INDEX ON TRAN_YEAR TAG TRAN_YEAR"
>
>What I want is the minimum and maximum years from the transaction tables which is simple
>
>select min( tran_year ), max( tran_year );
> from transact1 into array laRanges
>
>
>Here is the problem.
>If I am sitting at the command window and run it, no problem, comes back within a split second.
>
>While running the program, the form has a private data session and the table is opened. If I issue this exact same statement, it takes over a minute...
>
>So I tried to suspend the program immediately before this statement to trace any strangeness... but found nothing. I stepped through and again, it took over a minute. Immediately after that, I brought the command window up, changed the datasession to 1 (default), and issued the exact same command there and it took a split second...
>
>Any input on this would be greatly appreciated,
>TIA

The first suspicion is SET DELETED setting. If you have SET DELETED ON that you should have tag on DELETED(). However, you probablly don't need in SELECT_SQL at all in this case, just say:
Dimension Myarray(2)
Select Transact
SET Order To Tag Tran_Year
GO TOP
Myarray[1]=Transact.Tran_year
GO BOTTOM
Myarray[2]=Transact.Tran_year
Edward Pikman
Independent Consultant
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform