Difference between revisions of "TABLEMETADATAVERSION()"
Yvonne.milne (Talk | contribs) (Created page with "==Purpose== ==Syntax== TABLEMETADATAVERSION() ==See Also== ACLASS(), ADDPROPERTY(), AMEMBERS(), COLUMNMETADATA(), COMPOBJ(), CREATEOBJECT(), DATAB...") |
Yvonne.milne (Talk | contribs) |
||
Line 1: | Line 1: | ||
==Purpose== | ==Purpose== | ||
− | + | Function to return a table's metadata version | |
==Syntax== | ==Syntax== | ||
− | TABLEMETADATAVERSION() | + | TABLEMETADATAVERSION([<workarea | alias>]) |
==See Also== | ==See Also== | ||
− | [[ACLASS()]], [[ADDPROPERTY()]], [[AMEMBERS()]], [[COLUMNMETADATA()]], [[COMPOBJ()]], [[CREATEOBJECT()]], [[DATABASEMETADATA()]], [[DEFINE CLASS]], [[DISPLAY CLASSES]], [[DODEFAULT()]], [[FOREACH]], [[JSON_DECODE()]], [[JSON_DECODE_FILE()]], [[JSON_ENCODE()]], [[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 | + | [[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== | ==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== | ==Example== | ||
<code lang="recital"> | <code lang="recital"> | ||
+ | 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() ) | ||
+ | // ... | ||
</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() ) // ...