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: Bapi Roy
  Where is Bapi Roy?
 Alipurduar
 India
 Bapi Roy
 Tags
Subject: RE: What's the problem with my View?
Thread ID: 228462 Message ID: 228488 # Views: 2 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: General VFP Topics
Date: Tuesday, May 19, 2009 10:39:35 AM         
   


> && Variable
> lnSId = 2
> lcPo = "APD"
>
>
> && View Payslip
> CREATE SQL VIEW viewpayslip AS SELECT Workers.jcn, Workers.account, Workers.name, Payements.attend,;
> Payements.amount, Works.workrate, Workers.po FROM gpm!payements ;
> INNER JOIN gpm!workers ON Payements.wkridf = Workers.wkridx INNER JOIN gpm!works ;
> ON Payements.wkidxf = Works.wkidx WHERE Works.wkidx = lnSId;
> AND Workers.po = lcPo;
> ORDER BY Workers.account asc
>
> when I execute this code it create a view with variable name in place of variable value.
>
> I need this view created before in generate report.
>
> What is the problem in my view ?

I agree with Tushar and Boris on the '?parameter' syntax.

In addition, your description sounds as if you want to create the View at runtime?
If so, I'd recommend not to do so because you'd get serious DBC bloat, and perhaps even multi-user issues if the DBC is a shared persistent one.

IOW, I'd suggest to create it once at design-time, including the question marks as Tushar mentioned.
And at runtime, open it either with NoData clause, and do a Requery('yourView') after the parameter variables are available (or create the parameter variables first, and then Use theView).

Since your View does not seem to be updatable, even a simple temporary cursor might be enough for your report. I think.



hth
-Stefan

ENTIRE THREAD

What's the problem with my View? Posted by Bapi Roy @ 5/19/2009 8:08:17 AM
RE: What's the problem with my View? Posted by tushar @ 5/19/2009 8:09:32 AM
RE: What's the problem with my View? Posted by Bapi Roy @ 5/19/2009 8:14:49 AM
RE: What's the problem with my View? Posted by Borislav Borissov @ 5/19/2009 9:06:23 AM
RE: What's the problem with my View? Posted by Stefan Wuebbe @ 5/19/2009 10:39:35 AM
RE: What's the problem with my View? Posted by Bapi Roy @ 5/21/2009 4:10:20 PM