Hi!
View have such thing as parameters. Following is much better, because parameter variable should exists only when you open view or requery it:
create sql view tranhdr remote connection novtrans as SELECT * FROM tranhdr ;
WHERE pendcds = ?lcPendcds and repaired = 0 AND valerror = 0
HTH.
>Can you use variables when creating views?
>
>I am testing the creation of a view. When I hard code the parameter for the the field pendcds as below:
>
>create sql view tranhdr remote connection novtrans as SELECT * FROM tranhdr ;
> WHERE pendcds = 'w16' and repaired = 0 AND valerror = 0
>
>I have no problem, but when I pass a veriable, as below:
>
>lcPendcds = "w16"
>create sql view tranhdr remote connection novtrans as SELECT * FROM tranhdr ;
> WHERE pendcds = &lcPendcds and repaired = 0 AND valerror = 0
>
>I get an error stating that no filed named 'w16'.
>
>Question how to get around this?
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.comICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs
It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.