Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
I have a basic question about work areas
Message
De
09/02/2004 17:35:20
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
09/02/2004 17:10:13
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00875672
Message ID:
00875680
Vues:
15
>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)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform