>I am considering creating view programatically, instead of saving the definitions in the database. I am not (currently) asking how to do it; I will try to figure it out from the help, first.
>
>I think I may gain some flexibility, like having several slightly different versions of a view (say, with different parameters).
>
>What I do want to ask is:
>
>1) Is it very complicated to create views programatically?
>
>2) Is it worth the trouble? That is, perhaps there are too many problems involved, or perhaps there are better ways to do it.
>
>TIA, Hilmar.
1) No it's easy :)
2) Yes for sure :)
You didn't ask this part :
select ... into cursor myCursor
Strip 'into cursor myCursor' clause and add :
create SQL view <ViewName> as select ...
To create the view. IOW test your SQL first then make it a view.
Create a view in designer first and set its updatable properties. Then run gendbc to get programmatic version of DBC. You could examine extra settings for SendUpdates, KeyFields etc.
And neverthless to say use Evan's 'Eview'.
PS: Placing a 'force' clause make a view 'unopenable' by designer protecting it from spoiling.
Cetin