Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Bug about select command
Message
From
26/12/2006 23:36:01
Suhas Hegde
Dental Surgeon
Sirsi, India
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01180172
Message ID:
01180406
Views:
16
>VFP does open table test during query execution but it gets closed after query is completed. You can see it by running following code
>
>CREATE TABLE test (testfld c(10))
>USE
>USE test ALIAS atest
>SELECT *, UdfSusp() FROM atest INTO CURSOR qtest
>
>RETURN
>
>FUNCTION UdfSusp
>SET
>SUSPEND
>RETURN SPACE(1)
>
>To get result you want, create cursor test beforehand to prevent VFP from opening table test with alias test.
>
>CREATE TABLE test (testfld c(10))
>USE
>USE test ALIAS atest
>CREATE CURSOR test (DUMMY C(1))
>SELECT * FROM atest INTO CURSOR test
>
>
>>Try that code. The last line will give error. Because test table opened with "use test alias atest" command, so VFP won't open an alias for test table when running select command. If VFP don't open remotely test table aliased "test" why SELECT * FROM atest INTO CURSOR test command gives error?
>>
>>
>>
>>CREATE TABLE test (testfld c(10))
>>
>>USE
>>
>>USE test ALIAS atest
>>
>>SELECT * FROM atest INTO CURSOR qtest
>>
>>select test
>>
>>
Is it because Sql reads from disk and takes the original table name ? and is it the same behavior with VFP9 with buffering = .t. ??
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform