Results 1 to 9 of 9

Thread: Virtual tables

  1. #1

    Virtual tables

    I have been working with Virtual tables ("VT") using a local connection.
    I have read: http://www.lianja.com/resources/blog...-tables-part-1

    I have some general questions about VT:

    1. Am I correct in assuming that VT are the same as Views in VFP?
    2. For an app that will run on the web: Is it a good idea to build all my forms and grids using VT for everything? (I do this in VFP and want to know if I should also do it in Lianja).
    3. What is recommended: should VT be added to the same database as the tables, or should they be in a separate database?
    4. Is there any connection between the data dictionary for the table and the VT? Or should the VT data dictionary be filled in manually?
    Regards
    Cyril

  2. #2
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,159
    Blog Entries
    22
    Hi Cyril,

    1. No. They are a combination of Connection, CursorAdaptor and View. All the CRUD operations are handled for you (the SQL is generated by the engine) so they are updateable.

    2. Why would you use VTs against Lianja databases "for the Web"? Simple answer, No, its not necessary.

    3. Yes you should add it to the same database as your tables.

    4. When the VT is opened if a data dictionary exists for the VT name then it is also opened. However there are caveats in that the local table is recreated by executing the specified SQL for the VT. Therefore seqno() and such things are reset.

    Unless you want to use third party databases you do not need to use VTs.

    The Lianja Cloud Server does not yet handle VTs (as stated in the roadmap).
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  3. #3
    Senior Member
    Join Date
    Apr 2012
    Location
    United Kingdom
    Posts
    657
    Hi Barry,

    In many of our apps we need to display and use a select statements with joins so that we can display a record set which comprises of different fields from various tables.

    Is a VT not the best way to do in Lianja ?

    I am so used to using views for all my data that it's difficult for me, and I'm sure others here, to not think that way.

    David

  4. #4
    Hi Barry,

    Thanks for the answers. It clears things up.

    I have the same question as David.

    For example I want to show the user something like this:

    January Peter 500.00
    February Sally 2,459.12


    The table I used has foreign keys for the date and salesman. In VFP I use a view to show the user the description for the first two fields.

    How would I do that without using a VT for an app that will run on the web?

    Guess I would use keylookup.
    Last edited by cyrilbaskir; 2014-02-28 at 01:19.
    Regards
    Cyril

  5. #5
    Senior Member
    Join Date
    Apr 2012
    Location
    United Kingdom
    Posts
    657
    I would also guess keylookups, but then one is back to coding in the forms.

    I want to try to work as I do in VFP with metadata and be able to build things with as little code in the forms as possible to easy maintenance / development etc.

    Using Vt's allows me to get the data I want to display on the pages without having to set attributes in the controls, well as little as possible anyway.

    If one wants to write an app in Lianja that can be used to hit local databases, remote databases and in the future cloud, does one not have to use Vt's in any case in order to wrote once and be able to hit all data sources ?
    Last edited by avianmanagement; 2014-02-28 at 01:29.

  6. #6
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,159
    Blog Entries
    22
    The development roadmap includes VT support in the Cloud Server.

    In the desktop client you can use data mapping. This again is in the roadmap for the web/mobile client.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  7. #7
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,159
    Blog Entries
    22
    Yes it is. Cyril's questions were also related to web which is what as i referring to.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  8. #8
    Senior Member
    Join Date
    Apr 2012
    Location
    United Kingdom
    Posts
    657
    Thanks Barry,

    That is what I thought which is why I was going down that route with my development.

  9. #9
    Lianja MVP
    Join Date
    Feb 2012
    Location
    Berea, KY, USA
    Posts
    2,184
    1) yes (without the hassle of generating remote views, and can be made dynamic as to back end very easily);

    2) yes (when VT's are added to LCS in R6, per roadmap);

    3) yes (Lianja apps are made to run on 1 database);

    4) no (Barry has said "will be"), yes (ERD4Lianja will have a builder to do this for you)

    hth,

    Hank

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Journey into the Cloud
Join us