How to deal with VFP's local and remote views?
Hi Lianja Team,
I have an app containing approx 70 tables and 130+ local views.
This app started life in the Foxbase days, when Unix was supported, and was reluctantly ported to Windows at clients request, read insistence:(.
It now runs under VFP 9 SP2+.
At some stage, it shall be re-written to Lianja; imo the only REAL VFP alternative.
Lianja does not import a DBC's local and remote views.
The app's DBC has a few stored procedures, no triggers to speak of. No relationships have been specified; as parametrized views pull data in using the primary keys of the tables required.
I assume that it is possible in Lianja to replace a DBC's views with local and remote virtual tables.
Can someone knowledgeable please enlighten me?
Is it correct to assume that:
1. physical tables can be used in more than 1 virtual table?
2. it is possible to have virtual tables that contain columns from more than one table?
Is the FetchAsNeeded property of a virtual table, comparable to VFP's NoDataOnload? Meaning that virtual tables are only populated after a Requery?
What it boils down to, is that I have know how to work around the absence of views in order to be able to estimate the amount of work required to port the app to Lianja.
Any help is greatly appreciated.
Thanks!
Good news! I DO NOT local views in Lianja. (a newbie's opinion).
Hello, fellow developers looking to import your local views into Lianja,
To simulate local VFP views in Lianja, I create a virtual table for each view, using a routine to generate a script (prg); which I run from the console in Lianja.
(Discovered that the use of multiple underscores in a virtual table name is not a good idea; macro's do not work in the console; simulated NODATAONLOAD=.T. by "where 1=0", connstr="local")
Having had the opportunity to test the generated virtual tables for a few days, on tables, of max 1.5 GB, I have not seen performance reasons for maintaining virtual tables. Let me emphasize using my DBC's and environment.
I do not yet know how to quickly and easily move around or hide elements in forms. So to present a subset of the fields in records and to influence the order in which they appear, I now use virtual tables. This is most likely to change in the future.
I have dropped all my "old" virtual tables and am in the process of removing loads of indices or is it indexes, from my tables. Many existed to optimize view performance and for reporting purposes.
Quite superfluously, in order to get meaningful data from the generated views, their "where" clauses need to be replaced by appropriate values. Using the cursoradapters's requery method, does the trick for me.
After the implementation of local views and cursoradapters in Foxpro, many considered updating tables directly a No No, I was one of them. Someone mentioned to me, that I had to get rid of my old ways of thinking and start thinking the "Lianja" way. I have not been able to discover a manual yet, but I suppose that my changed opinion on the importance of views, might be a good example and I hope a step in the right direction.