METADATA VALUE()

From Lianjapedia
Revision as of 09:38, 10 April 2017 by Yvonne.milne (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Purpose

Function to return the value of the specified METADATA attribute

Syntax

METADATA_VALUE(<cAttribute>, <cSource>)

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 Editor, METADATA_DECODE(), METADATA_ENCODE(), METADATA_FINDTYPE(), NEWOBJECT(), OBJECT(), PRINT_JSON(), PRINT_HTML(), PRINT_R(), PRINT_XML(), REMOVEPROPERTY(), REQUIRE_ONCE(), SAVEOBJECT(), SQL SELECT, TABLEMETADATA(), TABLEMETADATAVERSION()

Description

The METADATA_VALUE() function is used to return the value of the specified METADATA attribute <cAttribute> from the source <cSource> as a character string.

Argument Description
<cAttribute> The attribute name as a character string.
<cSource> The MetaData source character string.

For conditional metadata, METADATA_VALUE() returns the value for the current record

METADATA_VALUE() returns an empty string if <cAttribute> does not exist or if there is no condition to match the current record.

Example

? databasemetadata("docdb")
// purpose=documentation;createddate=20170227;createdversion=3.4;distribution=internal
cCreatedVersion = metadata_value("createdversion",databasemetadata("docdb"))
? cCreatedVersion 
// 3.4
 
// Condition
use products order supplierid
? tablemetadata()
// section.backcolor=[supplierid gt 3]yellow;section.backcolor=[supplierid eq 1]red;section.backcolor=[supplierid eq 3]green;section.backcolor=[supplierid eq 2]blue
seek 3
? metadata_value("section.backcolor", tablemetadata(""))
// green
seek 2
? metadata_value("section.backcolor", tablemetadata(""))
// blue