R: tables

franco at hotelaqua.it franco at hotelaqua.it
Thu Mar 16 21:02:28 UTC 2023

My experience:
(keep in mind I'm not a professional developer. I barely know to code Omnis
and nothing else)
I started with Omnis 3. Not OmnisStudio 3 but the Blyte one, running (only)
on Mac(intosh), having 5 #Lists and some #numeric vars..
I've passed through Omnis5, then Studio 2, 3, 5, 8 and finally 10.22 (some
weeks ago)
Never, ever used table classes. All my calls/queries to DB are (were) placed
in Object Classes or in the window methods.
I ensure you the code works..
But now with 10.22 I'm starting using table classes, as I'm going to do
something with mobile devices, and I'm seeing all the advantages of using
Table classes.
Stephen is right: you don't HAVE to. But the engineers in Saxmundham made
tables available to make your coding easier, and much more "re-usable" along
the application that today is just a couple of windows, but tomorrow could
be hundreds. So you have one table class good for all them. You just create
a list, declare its subtype as tableClass and you just issue a single row
command and have the list back. From everywhere. Once and forever and for
all the object that will use that table-based list.
Fool me that I've never use them!

Just my 2 cents..

-----Messaggio originale-----
Da: omnisdev-en <omnisdev-en-bounces at lists.omnis-dev.com> Per conto di
Stephen Miller
Inviato: martedì 14 marzo 2023 17:45
A: OmnisDev List - English <omnisdev-en at lists.omnis-dev.com>
Oggetto: Re: tables


Why do I have to have that code in a table?
A; You don't. Do it the way you feel comfortable logically would be my

Kind Regards,

Stephen Miller


On Wed, 15 Mar 2023 at 03:25, Daniel Sananes <daniel.s at kopparbergs.se>

> Good afternoon, or what it might be somewhere else,
> Pardon my ignorance but I find this table-thing interfering with my 
> logical thinking.
> I am really starting to wonder what the difference is using the 
> table-approach or just have the same code somewhere else, maybe in a 
> code-class.
> The Table is the list, somehow and sort of, but I could as well just 
> call a method in a code-class and send the list in there.
> The $defienfromsqlclass seems to me just be the same as
> $schemas.SCHEMA.$makelist.$objs(ref.$name) returns LIST.
> Or is there something else in this I do not understand. Apart from 
> that the command invokes a table.
> If I have an order-window and are to create an order I will:
>   1.  Press a button called New order
>   2.  I will find a client that the order belongs to
>   3.  I will find articles that belongs to the order. These will be 
> orderrows.
>   4.  When finished the setup, I will press create the order.
> Am I supposed to have 3 tables working at the same time?
> The order has to be saved/inserted into the database with a new 
> primary key and the foreign key for the clients primary key has to be
> Then the orderrows has to be saved with the FK from the orders PK. And 
> new PK's has to be calculated for the orderrows/records.
> How would the setup be with the table-approach?
> I don't get it.
> Do I do 2 $inserts using 2 tables, one after the other? One for order 
> and one for orderrows.
> If $cinst.$servertablenames is a query there will be several schemas 
> to handle.
> I would say the schema is like the Omnis7 file format.
> $cinst.$servertablenames can contain several schemas (from query). How 
> would a table handle $insert or $update when there are several schemas?
> I would process each schema, building my own lists with $makelist, one 
> after the other, with correct SQL. Why do I have to have that code in 
> a table?
> /Daniel
> 0736 704070
> _____________________________________________________________
> Manage your list subscriptions at https://lists.omnis-dev.com Start a 
> new message -> mailto:omnisdev-en at lists.omnis-dev.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