Difference between revisions of "METADATA VALUE()"

From Lianjapedia
Jump to: navigation, search
(Created page with "''Under Construction'' ==Purpose== Function to return the value of the specified METADATA attribute ==Syntax== METADATA_VALUE(<cAttribute>, <cSource>) ==See Also== ACLASS(...")
 
(See Also)
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
''Under Construction''
 
 
==Purpose==
 
==Purpose==
 
Function to return the value of the specified METADATA attribute
 
Function to return the value of the specified METADATA attribute
Line 7: Line 6:
  
 
==See Also==
 
==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()]], [[TABLEMETADATAVERSION()]]
+
[[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==
 
==Description==
The METADATA_VALUE() function is used to return the value of the specified METADATA attribute <cAttribute> from the source <cSource>.
+
The METADATA_VALUE() function is used to return the value of the specified METADATA attribute <cAttribute> from the source <cSource> as a character string.
  
 
{| class="wikitable" width="100%"
 
{| class="wikitable" width="100%"
 
!width="25%"|Argument||width="75%"|Description
 
!width="25%"|Argument||width="75%"|Description
 
|-
 
|-
|valign=top|<cAttribute>||
+
|valign=top|<cAttribute>||The attribute name as a character string.
 
|-
 
|-
|<cSource>||
+
|<cSource>||The MetaData source character string.
 
|-
 
|-
 
|}
 
|}
  
METADATA_VALUE() returns an empty string if <cAttribute> does not exist or if the condition does not match.
+
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==
 
==Example==
 
<code lang="recital">
 
<code lang="recital">
 +
? 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
 
</code>
 
</code>
  

Latest revision as of 09:38, 10 April 2017

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