Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Do rules move to virtual tables

Hybrid View

  1. #1
    Senior Member
    Join Date
    Apr 2012
    Location
    United Kingdom
    Posts
    657

    Do rules move to virtual tables

    If on a table we have

    ALTER TABLE customer;
    ALTER COLUMN available CALCULATED limit-balance;
    ALTER COLUMN limit RECALCULATE;
    ALTER COLUMN balance RECALCULATE

    will that move over to a virtual table if it has those fields in it and work right away in the UI, or would it wait until the data went back to the table itself?

  2. #2
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,183
    Blog Entries
    22
    will that move over to a virtual table if it has those fields in it and work right away in the UI
    Please explain what you mean exactly.
    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
    If we have a table set up as above so that the available column is calculated If I use this tables fields for my UI then it will work

    If I use these fields in a virtual table where I have these fields and say other fields from orders etc.

    If I use the virtual table to create my UI on the pages / forms will it work the same in the UI or would it wait until the data was written back to the table to fire the calculated field, or are they in fact the same thing in reality.

  4. #4
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,183
    Blog Entries
    22
    Calculated fields are calculated when read from the table. So yes it will work from the Lianja SQL server as well.
    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

  5. #5
    Senior Member
    Join Date
    Apr 2012
    Location
    United Kingdom
    Posts
    657
    Quote Originally Posted by barrymavin View Post
    Calculated fields are calculated when read from the table. So yes it will work from the Lianja SQL server as well.
    OK now I'm confused, probably a misunderstanding of terminology on my part. You say these are calculated when read from the table, does that mean that in the UI using these fields from a virtual table, on the normal Lianja database rather than Lianja SQL server, would teh value in teh calculated filed alter on the UI when the user changed any of the other tow fields in the UI, in other words does the date in the form update in real time as the user enters or alters data.

  6. #6
    Quote Originally Posted by avianmanagement View Post
    If on a table we have

    ALTER TABLE customer;
    ALTER COLUMN available CALCULATED limit-balance;
    ALTER COLUMN limit RECALCULATE;
    ALTER COLUMN balance RECALCULATE
    David

    Did you try this?
    I typed it in at the console after Hank suggested I look at this. Didn't seem to do anything. Where does it go?

  7. #7
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,183
    Blog Entries
    22
    Quote Originally Posted by cyrilbaskir View Post
    David

    Did you try this?
    I typed it in at the console after Hank suggested I look at this. Didn't seem to do anything. Where does it go?
    Where does what go?

    Just do this to see the dictionary:

    Code:
    use customer
    list dictionary
    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
    Just looked at a table and it's attributes and there is no way to set this in the attributes, so I guess you have to do it in code.

  9. #9
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,183
    Blog Entries
    22
    Calculated fields in a database table are readonly and are calculated when written or read from the table. They will only be refreshed in the UI if you issue a refresh() on the section or field.
    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

  10. #10
    Senior Member
    Join Date
    Apr 2012
    Location
    United Kingdom
    Posts
    657
    OK thanks for clarifying that for me , now I understand how it works.

    So in the UI we would need to issue a Refresh() if any of the values changed in order for it to show up. This I guess we'd need to issue in the lost focus to make sure it always fired.

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