Results 1 to 4 of 4

Thread: Indexes and subrogates keys

  1. #1
    Junior Member
    Join Date
    Nov 2015
    Location
    San Juan, PR
    Posts
    5

    Indexes and subrogates keys

    Hi,

    I imported a VFP DBC into Lianja. Where do I configure the Indexes? I don't see where do I set them.

    In a Parent - child relation, do I need or can I use a subrogate key? How Lianja handles when a key like a Customer ID is change in the parent record? Will that field be changed in all child tables?

    How do I deal with this?

    Thanks

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

    After you imported your VFP dbc the indexes that you had are recreated in Lianja format.

    You can open the database with OPEN DATABASE in the console, open a table with USE, then use LIST STATUS to view the indexes.

    You can create new indexes using the VFP-style INDEX ON command or the SQL CREATE INDEX command.

    When you connect sections together using the relationship builder, Lianja uses heuristics to join the parent and child tables. If the columns it chooses for the relationship do not have an index, it will create the index for you. If that's not what you want, you edit the section attributes and change the parent-child expressions.

    Note that unlike VFP, Lianja indexes do not need converting to lower or upper case when looking up keys as this is all handled internally as is trimming of the keys to remove trailing white space.

    If you want to be able to break the parent-child relationship by editing the parent key, and you want to reassociate all child records to that new key, this can be done in a delegate such as the "change" delegate.

    Similarly, adding new records to a child section will fill the parent key automatically.
    Last edited by barrymavin; 2016-06-10 at 05:03.
    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
    Junior Member
    Join Date
    Nov 2015
    Location
    San Juan, PR
    Posts
    5
    Thank Barry,

    Are delegates like the VFP properties or methods?

    Would you say that I don't need to create indexes in new tables I create in Lianja? Do LIanja needs the indexes to be created or Lianja creates them as needed?

    If I have a subrogate key that relates the tables, what happen when I create a record in a child table? ia the key value added automatically?

    Thanks again,

  4. #4
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,165
    Blog Entries
    22
    Delegates are similar to VFP event handling procs but they are scripting language independent.

    In most cases Lianja will build the indexes as you develop your app visually. There are cases however (e.g for SQL optimization) where you need to create indexes manually.

    Yes the key will be added automatically as long as the child key expression is a single column. If it is an expression then you need to handle that inside validation or an oninsert trigger.
    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

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