Discussion:
Select SQL
(too old to reply)
Charly Pruemm
2006-03-03 14:35:17 UTC
Permalink
What is the difference between these 2 possibilities?

pcDatapath is the direcory where myDatabase and tables are stored..!

1.)

if !dbused('MyDatabase')
open database (pcDatapath+'MyDatabase') shared
endif
set database to myDatabase

select * from myDatabase!customers where state='Michigan' into cursor
curCustumers

versus:

2.) Dont open the database but:

select * from (pcDatapath+'customers') where state='Michigan' into cursor
curCustumers

Query the table directly over its path and tablename


Thanks for advises

CHARLY
Dan Freeman
2006-03-03 16:26:44 UTC
Permalink
No functional difference at all.

Some will give you style points for going one way over the other. (My
preference is to let the database keep track of where its tables are.)
That's about it.

Just be aware that by directly referencing the table, the dbc will be opened
automatically.

Dan
Post by Charly Pruemm
What is the difference between these 2 possibilities?
pcDatapath is the direcory where myDatabase and tables are stored..!
1.)
if !dbused('MyDatabase')
open database (pcDatapath+'MyDatabase') shared
endif
set database to myDatabase
select * from myDatabase!customers where state='Michigan' into cursor
curCustumers
select * from (pcDatapath+'customers') where state='Michigan' into
cursor curCustumers
Query the table directly over its path and tablename
Thanks for advises
CHARLY
Craig Berntson
2006-03-03 21:46:37 UTC
Permalink
Unless you have SET EXCLUSIVE OFF, the first method will open the DBC shared
and the table exclusive. The second method will open both the DBC and the
DBF exclusive.
--
Craig Berntson
MCSD, Visual FoxPro MVP
www.craigberntson.com
Salt Lake City Fox User Group
www.slcfox.org
www.foxcentral.net
Post by Charly Pruemm
What is the difference between these 2 possibilities?
pcDatapath is the direcory where myDatabase and tables are stored..!
1.)
if !dbused('MyDatabase')
open database (pcDatapath+'MyDatabase') shared
endif
set database to myDatabase
select * from myDatabase!customers where state='Michigan' into cursor
curCustumers
select * from (pcDatapath+'customers') where state='Michigan' into cursor
curCustumers
Query the table directly over its path and tablename
Thanks for advises
CHARLY
Loading...