Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Stefan Wuebbe
  Where is Stefan Wuebbe?
 Hamburg
 Germany
 Stefan Wuebbe
 To: Ahsan Rana
  Where is Ahsan Rana?
 Lahore
 Pakistan
 Ahsan Rana
 Tags
Subject: RE: Conditional View in MySql
Thread ID: 365665 Message ID: 365694 # Views: 38 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Databases, Tables and SQL Server
Date: Sunday, December 30, 2012 1:13:28 PM         
   


> >
> > David,
> >
> > That's a typical "parameterization" issue - in VFP you can use the "?" question-mark syntax with ODBC sources, like ODBC CursorAdapters, SPT or Remote Views, and also with native SQL.
> > (With OleDB sources, the syntax would be slightly different.)
> >
> > SPT example:
> >
> >
> > Local lcSQL, lcName, lnSuccess
> > lcSQL = "Select col1, col2 From rdbmsTable Where nameColumn = ?m.lcName"
> > lcName = "Smith"
> > lnSuccess = SqlExec(m.lcSQL)
> > && If m.lnSuccess < 0 use AError() to get the server's complaints
> > 

> >
> >
> >
> > hth
> > -Stefan
>
> Thnx for reply, the problem solved with the help of the following code but still I could not understand how it behave in multiuser environment.
>
>
> LPARAMETERS ac
>
> = SQLEXEC(mConn,"Drop View Ldg")
>
> TEXT TO mQry NOSHOW
> CREATE VIEW Ldg as Select * From Inv Where Itm_Code = ?ac
> ENDTEXT
>
> = SQLEXEC(mConn,mQry)
>
> IF AERROR(mErr) > 0
> WAIT WINDOW mErr(2)
> ENDIF
>
> = SQLEXEC(mConn,"SELECT * FROM Ldg")
> BROWSE
> <\vfp>
>
> Rgds:
> Ahsan Rana


A database "View" is a persistent structure that would get created only once usually, just like a table that you would not Create in the client code.
I do not use MySQL myself but a web search might get you started
https://www.google.com/search?q=mysql+parameterized+view



hth
-Stefan

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