Difference between revisions of "TABLEMETADATAVERSION()"
Yvonne.milne (Talk | contribs) |
Yvonne.milne (Talk | contribs) |
||
Line 16: | Line 16: | ||
<code lang="recital"> | <code lang="recital"> | ||
parameter id | parameter id | ||
− | local osection = Lianja.getElementByID( id ) | + | local osection = Lianja.getElementByID(id) |
// check to see if UI section attributes are same version as last time applied | // check to see if UI section attributes are same version as last time applied | ||
Line 24: | Line 24: | ||
endif | endif | ||
osection.metaDataVersion = tableMetaDataVersion() | osection.metaDataVersion = tableMetaDataVersion() | ||
− | local omd = metadata_decode( tableMetaData() ) | + | local omd = metadata_decode(tableMetaData()) |
// ... | // ... | ||
</code> | </code> |
Revision as of 10:48, 27 February 2017
Contents
Purpose
Function to return a table's metadata version
Syntax
TABLEMETADATAVERSION([<workarea | alias>])
See Also
ACLASS(), ADDPROPERTY(), ALTER TABLE, AMEMBERS(), COLUMNMETADATA(), COMPOBJ(), CREATE TABLE, CREATEOBJECT(), DATABASEMETADATA(), DEFINE CLASS, DISPLAY CLASSES, DODEFAULT(), FOREACH, JSON_DECODE(), JSON_DECODE_FILE(), JSON_ENCODE(), Lianja MetaData API, LIST CLASSES, LOADOBJECT(), METADATA_DECODE(), METADATA_ENCODE(), METADATA_FINDTYPE(), NEWOBJECT(), OBJECT(), PRINT_JSON(), PRINT_HTML(), PRINT_R(), PRINT_XML(), REMOVEPROPERTY(), REQUIRE_ONCE(), SAVEOBJECT(), SQL SELECT, TABLEMETADATA()
Description
The TABLEMETADATAVERSION() function returns the metadata version for the current table as an integer. If the optional <workarea | alias> is specified, then the function will return the version from that workarea or alias. If no metadata has been applied to the table or there is no table open in the current or specified workarea, TABLEMETADATAVERSION() returns 0.
A table's metadata version is incremented by 1 each time a change is made to its metadata using ALTER TABLE.
Example
parameter id local osection = Lianja.getElementByID(id) // check to see if UI section attributes are same version as last time applied // and if so do nothing (improves performance) if osection.metaDataVersion = tableMetaDataVersion() return endif osection.metaDataVersion = tableMetaDataVersion() local omd = metadata_decode(tableMetaData()) // ...