COLUMNMETADATA()

From Lianjapedia
Revision as of 10:06, 5 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 metadata string from the Active Data Dictionary associated with the specified column

Syntax

COLUMNMETADATA(<cColumn>)

See Also

ACLASS(), ADDPROPERTY(), AMEMBERS(), COMPOBJ(), CREATEOBJECT(), DATABASEMETADATA(), DEFINE CLASS, DISPLAY CLASSES, DODEFAULT(), FOREACH, JSON_DECODE(), JSON_DECODE_FILE(), JSON_ENCODE(), 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, SOCKET_CLOSE(), SOCKET_LASTERROR(), SOCKET_OPEN(), SOCKET_PEEK(), SOCKET_READ(), SOCKET_SERVER(), SOCKET_WRITE(), TABLEMETADATA(), TABLEMETADATAVERSION(), WITH, XML_DECODE_FILE()

Description

The COLUMNMETADATA() function is used to return the metadata string from the Active Data Dictionary associated with the specified column. COLUMNMETADATA() returns an empty string if no metadata has been applied to the specified column or the column reference is not valid.

Argument Description
<cColumn> A character string reference to one of the following:
- column name of a column in the currently open table
- table.column in the currently open database
- database!table.column, which can be used whether the database is open or not

Example

// database!table.column
? columnMetaData("southwind!customers.customerid")
// table.column
open database southwind
? columnMetaData("customers.customerid")
// column
use customers
? columnMetaData("customerid")
 
// Use with metadata_decode() and metadata_encode()
open database southwind
use customers
omd = object()
omd.caption = "Customer Name"
omd.searchfield = .t.
alter table customers modify constraint companyname metadata metadata_encode(omd)
use customers
omd = metadata_decode(columnMetaData("companyname"))
omd.caption = "Customer"
omd.picture = "@!"
omd.searchfield = .t.
alter table customers modify constraint companyname metadata metadata_encode(omd)
?  metadata_decode(columnMetaData("companyname"))
 
 
 
Object (refcnt=1)
(
    [caption] => Customer
    [searchfield] => True
    [picture] => @!
)