Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select Statement Confusion
Message
 
 
À
30/11/1999 12:09:31
Jimmy Ditta
Twin City Electronics
Monroe, Louisiane, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00296934
Message ID:
00296948
Vues:
15
>In the button's click event I put this code:
>
>select data1.boardfeet, data2.boardfeet, data3.boardfeet, data1.total, data2.total, data3.total;
> from data1, data2, data3;
> where data1.siz = thisform.pageframe1.page2.sz1.displayvalue;
> or data2.siz = thisform.pageframe1.page2.sz1.displayvalue;
> or data3.siz = thisform.pageframe1.page2.sz1.displayvalue;
>
>I'm not getting what I'm supposed to.

Do not put object reference values in the SQL. Use local variables instead. Ideally, I would create a parameterized SQL view.
create sql view myview as ;
select data1.boardfeet, data2.boardfeet, data3.boardfeet, ;
   data1.total, data2.total, data3.total ;
   from data1, data2, data3;
   where data1.siz = ?cSize ;
   or data2.siz    = ?cSize ;
   or data3.siz    = ?cSize ;
   blah, blah, blah
In the form, open MyView with the NODATA clause. For example, put the view in the Data Environment, set the NoDataOnLoad property to TRUE, in the BeforeOpenTables, include the following:

set talk off
set deleted on
set exclusive off
set multilocks on

Then in the Click of your command button:

local cSize
cSize = alltrim(thisform.pageframe1.page2.sz1.displayvalue)
requery("MyView")
Mark McCasland
Midlothian, TX USA
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform