Page 1 of 1

dbobject_reloadSchema or tableobjects_reload

Posted: Fri Oct 11, 2013 2:03 pm
by trevordevore
[This post is an archive from old SQL Yoga forums]

I am not clear about when to use these?

Specifically - say you drop a table - would have thought that "tableobjects_reload" would do the trick, but seems you need to reload the schema as well, so do I then need to "tableobjects_reload". A longer explanation would be good to understand what exactly is going on with each command?

Re: dbobject_reloadSchema or tableobjects_reload

Posted: Fri Oct 11, 2013 2:04 pm
by trevordevore
Use the diagram in this lesson on the Database Object and Database Schema as a reference. Notice the the Schema and Table Objects are independently of each other even though they are both part of the database object.

The schema stored inside of the database object has information specific to the actual design of your database. If you delete a table from the database itself then dbobject_reloadSchema is what you would call in order for SQL Yoga to update the database object with the new schema.

Table objects do not necessarily mirror the tables in your schema though and are only affected by the code that you place in the table objects behavior. If you change the code in the table objects behavior then you call tableobjects_reload.

So in your case, calling tableobjects_reload does nothing since you haven't changed any of your code. dbobject_reloadSchema is what you want since the change was in your database design.

Re: dbobject_reloadSchema or tableobjects_reload

Posted: Fri Oct 11, 2013 2:04 pm
by trevordevore
Clear - thanks. I'll think of "tableobjects_reload" as "tablebehavior_reload" from now on so I can remember it's associations better :)