Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Anders Altberg
  Where is Anders Altberg?
 Uppsala
 Sweden
 Anders Altberg
 To: Ahsan Rana
  Where is Ahsan Rana?
 Lahore
 Pakistan
 Ahsan Rana
 Tags
Subject: RE: Conditional View in MySql
Thread ID: 365665 Message ID: 365707 # Views: 35 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Databases, Tables and SQL Server
Date: Sunday, December 30, 2012 4:09:15 PM         
   


> Hi Experts
>
> I want to create View in MySql with Where Condition and Where Condition is variable. User can select any product from VFP Form and View in MySql will select data only for the selected product.
>
> Rgds:
> Ahsan Rana

A parameterized remote view is a query with a variable WHERE clause stored in a VFP database. The database can be temporary, ad hoc, or permanent. It uses a connection object which can bge a DSN or a connection string, saved in the database:
CREATE [SQL] VIEW [ViewName] [REMOTE] [CONNECTION ConnectionName [SHARE] | CONNECTION DataSourceName][AS SQLSELECTStatement]


OPEN DATABASE X 
CREATE SQL VIEW viewname REMOTE AS SELECT * FROM MySQLTable WHERE col2 LIKE ?myvariable
Is there any reason to assume that a (temp) parametrerized view in MySQL will perform better than a parameterized remote view, defined with the same query, stored in a VFP database?

Does the view need to be updatable so that the user can apply new data, or delete rows, and have the modifications brought back to view's source tables?

When VFP was designed the Fox team put a lot of work into making romete and local views the easiest way to work by providing a view design tool, where everything needed could be done with clicks of as mouse, and all the code needed to manage the view was reduced to a few VFP function calls:
USE viewname [NODATA] [CONNSTRING x|n]
REQUERY('viewname') 
TABLEUPDATE(,,'viewname',)
TABLEREVERT(,,'viewname') 


With SPT calls none od these shortcuts are available.


-Anders

ENTIRE THREAD

Conditional View in MySql Posted by Ahsan Rana @ 12/29/2012 6:40:17 PM
RE: Conditional View in MySql Posted by Rick Hodgin @ 12/29/2012 7:36:07 PM
RE: Conditional View in MySql Posted by Ahsan Rana @ 12/30/2012 9:59:20 AM
RE: Conditional View in MySql Posted by Michel Levy @ 12/30/2012 11:10:28 AM
RE: Conditional View in MySql Posted by David Mustakim @ 12/30/2012 11:30:42 AM
RE: Conditional View in MySql Posted by Stefan Wuebbe @ 12/30/2012 12:51:16 PM
RE: Conditional View in MySql Posted by Ahsan Rana @ 12/30/2012 1:01:04 PM
RE: Conditional View in MySql Posted by Stefan Wuebbe @ 12/30/2012 1:13:28 PM
RE: Conditional View in MySql Posted by David Mustakim @ 12/30/2012 4:40:56 PM
RE: Conditional View in MySql Posted by Michel Levy @ 12/30/2012 5:59:59 PM
RE: Conditional View in MySql Posted by David Mustakim @ 12/30/2012 6:53:52 PM
RE: Conditional View in MySql Posted by Michel Levy @ 12/30/2012 1:06:01 PM
RE: Conditional View in MySql Posted by Rick Hodgin @ 12/30/2012 2:59:44 PM
RE: Conditional View in MySql Posted by Michel Levy @ 12/30/2012 6:19:54 PM
RE: Conditional View in MySql Posted by Rick Hodgin @ 12/30/2012 11:46:35 PM
RE: Conditional View in MySql Posted by Michel Levy @ 12/31/2012 12:08:20 PM
RE: Conditional View in MySql Posted by Rick Hodgin @ 12/31/2012 9:37:10 PM
RE: Conditional View in MySql Posted by Michel Levy @ 12/30/2012 6:20:12 PM
RE: Conditional View in MySql Posted by Rick Hodgin @ 12/31/2012 12:06:08 AM
RE: Conditional View in MySql Posted by M. Tanveer Ul Hassan Shaheen @ 12/29/2012 9:05:17 PM
RE: Conditional View in MySql Posted by M. Tanveer Ul Hassan Shaheen @ 12/29/2012 9:11:09 PM
RE: Conditional View in MySql Posted by David Mustakim @ 12/30/2012 1:49:10 PM
RE: Conditional View in MySql Posted by Anders Altberg @ 12/30/2012 4:09:15 PM