Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
>Another silly question,
>Can I use the following sql statement to create sql view:
>'CREATE SQL VIEW MYVIEW AS SELECT * FROM MYTBL WHERE MYFIELD=Thisform.value'
>I found 'Thisform.value' can be replaced by a PUBLIC VARIABLE but I rather like to use local variable.
>
>Shall I change my mind?
>
>Sunny
Yes, you can do that... you should have a ? before the property like...
'CREATE SQL VIEW MYVIEW AS SELECT * FROM MYTBL WHERE MYFIELD=?Thisform.value'
However, it is, as others have said, better to use a variable, and populate it prior to using or requerying the view...
'CREATE SQL VIEW MYVIEW AS SELECT * FROM MYTBL WHERE MYFIELD=?vp_value'
local vp_value
vp_value = ThisForm.Value
use MyView
BOb
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement