>Thanks in advance for your forebearance of my ignorance. I have many years of SQL experience(sybase,oracle,mysql,sql/ds,etc), but am new to foxpro.
>I can't seem to grasp the notion of work area. Inside my application code, I can use the "select 0" and "use (table name)" commands to gain access to a table, but there are other parts my application where I have not done this, and can still do "select * from (table name) into (some other table name) where (constraints)". My application is intended to run on a client platform, where tables are stored on a network-connected data server. Can someone please explain the bindings(or whatever) that happens during compiletime and runtime that "select (work area)/use (table name)" controls?
>Or why these explicit commands are apparently not always necessary?
>Many thanks, PC
First of all, I am not sure you understand that SELECT (workarea or alias) and SELECT - SQL are two very different commands, so let me briefly explain.
SELECT (workarea) will change to a different work area. A work area is a "slot" where you can open a table.
select 1
use client
select 2
use invoice
select 1
? reccount()
This will show you the corresponding data for table client, because client was opened in area 1. (For safer programming, I would usually SELECT 0, so that VFP decides on a free work area, instead of the programmer. Also, I would usually change SELECT 1 to SELECT CLIENT, for clarity.)
SELECT - SQL is the standard SQL command, integrated into VFP. In the case of VFP, it will create a new cursor, in a new work area, and select this new work area.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)