Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Issues creating views
Message
De
07/08/2002 05:31:15
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Allemagne
 
 
À
01/08/2002 22:09:36
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00684813
Message ID:
00686923
Vues:
34
Hi Romano,

i think the Problem is within your parameter, the SELECT SQL is Ok.

Thats what I do
*Declaration
lcWhere=''

CREATE SQL VIEW 'prean' AS SELECT blah, blah  INNER JOIN;
	pre ON blah, blah &?lcWhere


*usage
if needWhere THEN
 cLista = '0'
 lcWhere = 'ALLTRIM(STR(pre.p,20,0))$cLista'
*compare with .t. is obsolete

*or better:

lcWhere = 'ALLTRIM(STR(pre.p,20,0))$"'+cLista+'"'
*so the string is complete

ELSE
*no where declared, nothing done (all records in view)
lcWhere =' '
ENDIF

use prean
important is to miss "?" in lcWhere

Agnes
>>If the parameter variable exists before you create the view then it should not have to ask you for it.
>>
>
>Other people have suggested me you answer too, but it hasn't worked yet.
>Here is a example of what I'm trying to do:
>
>cLista='0'
>cExpr='ALLTRIM(STR(pre.p,20,0))$?cLista=.T.'
>
>
>CREATE SQL VIEW 'prean' AS SELECT blah, blah INNER JOIN;
> pre ON blah, blah where &?cExpr
>
>I even tried this:
>
>cLista='0'
>
>CREATE SQL VIEW 'prean' AS SELECT blah, blah INNER JOIN;
> pre ON blah, blah where ALLTRIM(STR(pre.p,20,0))$?cLista
>
>
>Before I added the 'where &?cExpr' the view worked well. Moreover I
>had used the same expression in a view before and it had worked
>too, but now I don't know why the combination isn't working.
>
>what could be wrong?
>Could be that I'm using a cursor?
>
>The error message I get says something about a key word is not being recognized in a command.
>
>
>Thanks for your answer.
>
>
>>As far as pre creating the view is concerned I think you can do that, as a view can use a free table so why not a cursor? Just create the cursor before you create the view and don't forget to create the cursor before you try to edit the view later on.
>>
>>HTH
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform