Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Creating view programmatically
Message
From
23/10/2001 11:41:51
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
23/10/2001 11:33:24
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00572083
Message ID:
00572088
Views:
27
This message has been marked as a message which has helped to the initial question of the thread.
>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
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform