Query class question

TBS andyh at totallybrilliant.com
Mon Nov 20 13:52:07 UTC 2023


You have to tell the database how the ‘other’ tables are connected to the main (or any other tables) by adding to a ‘where’ clause

Currently you are not telling it any type of ‘where’ (you are literally just saying get the entire main table and it simply does not know how to deal with the extra table data which is why you get a failure)

An example here would be ‘WHERE tableB.primarykeyname = tableA.foreignkeyname’ - that would be enough to tell it how to pull in data from tableB when you are primarily looking up entries in tableA

You could try this as a good reading start : https://www.postgresqltutorial.com/postgresql-tutorial/postgresql-where/

Andy Hilton
Totally Brilliant Software Inc
Phone (US) : (863) 409 4870
Phone (UK) : 0207 193 8582
Web : www.totallybrilliant.com
Helpdesk : https://totallybrilliantsoftware.supportsystem.com/
Email : andyh at totallybrilliant.com
On Nov 20, 2023, 8:35 AM -0500, Mike Rowan <mgrowan at fastmail.com>, wrote:
> I am sorry to bother the list again with something that's probably simple, but I'm stuck.
> I have a PG table of data. I have an Omnis schema and table class for it. I want to load the data into a list, so I do this:
> Do iList.$definefromsqlclass('tauthors')
> Do iList.$select() Returns #F
> Do iList.$fetch(kfFetchAll)
> That works.
> Now I also have a query class, simplest possible. Every column from the sauthors Omnis schema only. No extra text.
> If I change the above pseudocode slightly, to use the query, as in:
> Do iList.$definefromsqlclass('qauthors')
> Do iList.$select() Returns #F
> Do iList.$fetch(kFetchAll)
> it fails with #F = 0 though the column names are correctly shown in the list. I don't understand why. Any hint would be welcome. As would a pointer to any more descriptive documentation than I've been able to find in the official online docs.
> Mike Rowan
> Mobile: 0417 812 509
> Email: mgrowan at fastmail.com
> _____________________________________________________________
> Manage your list subscriptions at https://lists.omnis-dev.com
> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com

More information about the omnisdev-en mailing list