$assigrow problem

Joe Maus jmaus at theccgllc.com
Thu Apr 23 14:44:43 EDT 2009

----- Brian O'Sullivan <brian.os at verizon.net> wrote:
> Rainer R. Greim wrote:
> > isnt a shema class something like a struct in C, C++ but more readable.
> > So couldnt u use it for almost everything, in a more comfortable way...
> Yes, you can use schemas for more than just database structure modeling, 
> although that is their intended use.

Use schemas for anything you want defined in a standard manner.  As Brian alluded to they can be used to define any list or row.  I use them to handle "views" and to define what is returned to lists in stored procedures and thus I'm assured I don't make a mistake in defining something locally by missing a column or whatever...  Think of them as "predefined" list headers.

Keep in mind that adding a column to a list or row using the $add() notation automatically EXCLUDES that column from any insert/update/delete code Omnis would generate as part of a smartlist or $insert/$update/$delete operation - this assumes the schema is describing the table in the database exactly.  You may add columns to your lists to show "lookup items" and the like and this is a handy way to have the ability to have Studio do the $insert/$update... without having to "exclude" columns that you might otherwise add to the schema to show those lookup columns.  Long story short, if you're doing $insert/$update kind of operations, you want that schema to map column for column to the database table and then do $add() to handle any "special" columns you might like back from the database as part of a select.

Joe Maus

More information about the omnisdev-en mailing list