Groups > Superbase > Superbase NG > Re: Clarifying SBME1




Clarifying SBME1

Clarifying SBME1
Wed, 12 Dec 2007 12:27:41 -050
I continue to work my way through trying to understand things.

I am confused by the distinction between and the need for both of these 
objects:

sbme1newtable

and

sbme1table

So far as I can figure out:

1A. sbme1newtable is used to create a new table within a "datasource",

a.k.a. sbme1 object.

1B. sbme1newtable is used to create fields and indexes for that new table.

corresponding SBL CREATE, ADD, and MAKE  as in e.g.

CREATE "Address"
ADD "Firstname;TXT REQ;20;1;2"
ADD "Lastname;TXT REQ;20;1;33"
ADD "Street;TXT;25;3;2"
...
(other field definitions)
...
MAKE "Address"

and also CREATE INDEX ON and REMOVE

On the other hand,

2A. sbme1table is what you use to ADD a record

corresponding SBL, I guess

BLANK which becomes sbme1tablevar.newrecord()

STORE  which becomes  smbe1var.commit   NOTE:  If you have a datasource 
(sbme1 object) with two tables (smbe1table objects) and you make changes
to [a] record[s] within an smbe1table you have to use the commit method 
on datasource/smbe1 object not just the table/sbme1table object.

Have I described this correctly?













Post Reply
Re: Clarifying SBME1
Thu, 13 Dec 2007 11:36:08 +000
Kromkowski wrote:
> I continue to work my way through trying to understand things.
> 
> I am confused by the distinction between and the need for both of these
> objects:
> 
> sbme1newtable
> 
> and
> 
> sbme1table
> 
> So far as I can figure out:
> 
> 1A. sbme1newtable is used to create a new table within a
"datasource",
> a.k.a. sbme1 object.
> 
> 1B. sbme1newtable is used to create fields and indexes for that new table.
> 
> corresponding SBL CREATE, ADD, and MAKE  as in e.g.
> 
> CREATE "Address"
> ADD "Firstname;TXT REQ;20;1;2"
> ADD "Lastname;TXT REQ;20;1;33"
> ADD "Street;TXT;25;3;2"
> ....
> (other field definitions)
> ....
> MAKE "Address"
> 
> and also CREATE INDEX ON and REMOVE

That is correct. It was not considered to be a good design decision to
add all the overhead for table creation and modification to the standard
database table object. There were also issues during creation where the
table doesn't exist yet and the problem of preventing people from
calling methods that can't yet possibly work. To that end, the objects
were created that are used for creating a new database table and its
components.

Later, to allow for table modification, functionality was added to
retrieve an existing table definition into one of these objects to allow
for modification.

> On the other hand,
> 
> 2A. sbme1table is what you use to ADD a record
> 
> corresponding SBL, I guess
> 
> BLANK which becomes sbme1tablevar.newrecord()
> 
> STORE  which becomes  smbe1var.commit   NOTE:  If you have a datasource
> (sbme1 object) with two tables (smbe1table objects) and you make changes
> to [a] record[s] within an smbe1table you have to use the commit method
> on datasource/smbe1 object not just the table/sbme1table object.

Not quite.

STORE corresponds to sbme1tablevar.saverecord(). You may have set the
sbme1 to auto commit mode, so you may not need the commit() call. That
would be most similar to the way Superbase works. If you don't do that,
then you need to remember to do the commit() call yourself, or all the
changes are discarded.

Post Reply
about | contact