Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Dynamic View
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
00540559
Message ID:
00540642
Vues:
22
Chris,
When you create a view, the source SQL is stored in the DBC. When you run the CREATE SQL VIEW code, any macro substitution on the left side of the = sign is done at that time and embedded in the source. You can't change it on the fly unless you rebuild the view when you do this.

Do you need a view or can you create an object that receives a SQL string and executes it? The "requery" could simply execute the statement and overwrite the cursor already generated.

HTH.

>Hi - just checking I am barking up the right tree!
>
>I want a view that pulls out records from a base table. The user selects all customers so I have a view with this SQL...
>
>SELECT *;
> FROM gen_data!customers;
> WHERE Customers.cu_primary BETWEEN ?vp_LowPk AND ?vp_HighPk;
> AND DELETED() <> .T.;
> ORDER BY Customers.cu_company
>
>That's fine. But can't I use the following SQL and supply a value for vp_Field and vp_Criteria so that it widens the possibilities?
>
>SELECT *;
> FROM gen_data!customers;
> WHERE Customers.cu_primary BETWEEN ?vp_LowPk AND ?vp_HighPk;
> AND ?vp_Field = ?vp_Criteria;
> AND DELETED() <> .T.;
> ORDER BY Customers.cu_company
>
>I am passing vp_Field = "customers.cu_code" and vp_Criteria as "EMD" (a company code)
>
>This doesn't seem to work and the problem seems to lie with assigning a field.
>
>Am I missing something? Any ideas?
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform