TABLEMETADATAVERSION()

From Lianjapedia
Revision as of 10:48, 27 February 2017 by Yvonne.milne (Talk | contribs)

Jump to: navigation, search

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())
// ...