Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select Statement Confusion
Message
 
 
To
30/11/1999 12:09:31
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00296934
Message ID:
00296948
Views:
16
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform