Difference between revisions of "DATABASEMETADATA()"
Yvonne.milne (Talk | contribs) |
Yvonne.milne (Talk | contribs) |
||
Line 1: | Line 1: | ||
''Under Construction'' | ''Under Construction'' | ||
==Purpose== | ==Purpose== | ||
− | + | Function to return the current database's metadata as a character string | |
==Syntax== | ==Syntax== | ||
Line 10: | Line 10: | ||
==Description== | ==Description== | ||
+ | The DATABASEMETADATA() function returns the current database's metadata as a character string. Database metadata can be defined using the MetaData Editor in the Data workspace or using the [[CREATE DATABASE]] or [[ALTER DATABASE]] SQL commands. | ||
+ | Database metadata is stored in the <database-basename>.cad file in the database's directory. | ||
==Example== | ==Example== | ||
<code lang="recital"> | <code lang="recital"> | ||
+ | // Name value pairs for use with the MetaData Editor | ||
+ | alter database southwind metadata "company=Lianja Inc.;contact=sales@lianja.com" | ||
+ | open database southwind | ||
+ | ? databaseMetaData() // --> 'company=Lianja Inc.;contact=sales@lianja.com' | ||
+ | // Assignments are not cumulative | ||
+ | alter database southwind metadata "purpose=Sample Database" | ||
+ | open database southwind | ||
+ | ? databaseMetaData() // --> 'purpose=Sample Database' | ||
+ | // Specifying an empty string clears the metadata | ||
+ | alter database southwind metadata "" | ||
+ | open database southwind | ||
+ | ? databaseMetaData() // --> '' | ||
+ | |||
+ | |||
+ | // JSON string | ||
+ | alter database sw2 metadata '{"purpose":"Documentation Test Database","owner":"Yvonne Milne"}' | ||
+ | open database sw2 | ||
+ | ? databasemetadata() // --> '{"purpose":"Documentation Test Database","owner":"Yvonne Milne"}' | ||
</code> | </code> | ||
Revision as of 11:48, 24 February 2017
Under Construction
Contents
Purpose
Function to return the current database's metadata as a character string
Syntax
DATABASEMETADATA()
See Also
ACLASS(), ADDPROPERTY(), ALTER DATABASE, AMEMBERS(), COLUMNMETADATA(), COMPOBJ(), CREATEOBJECT(), 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, SOCKET_CLOSE(), SOCKET_LASTERROR(), SOCKET_OPEN(), SOCKET_PEEK(), SOCKET_READ(), SOCKET_SERVER(), SOCKET_WRITE(), TABLEMETADATA(), TABLEMETADATAVERSION(), WITH, XML_DECODE_FILE()
Description
The DATABASEMETADATA() function returns the current database's metadata as a character string. Database metadata can be defined using the MetaData Editor in the Data workspace or using the CREATE DATABASE or ALTER DATABASE SQL commands.
Database metadata is stored in the <database-basename>.cad file in the database's directory.
Example
// Name value pairs for use with the MetaData Editor alter database southwind metadata "company=Lianja Inc.;contact=sales@lianja.com" open database southwind ? databaseMetaData() // --> 'company=Lianja Inc.;contact=sales@lianja.com' // Assignments are not cumulative alter database southwind metadata "purpose=Sample Database" open database southwind ? databaseMetaData() // --> 'purpose=Sample Database' // Specifying an empty string clears the metadata alter database southwind metadata "" open database southwind ? databaseMetaData() // --> '' // JSON string alter database sw2 metadata '{"purpose":"Documentation Test Database","owner":"Yvonne Milne"}' open database sw2 ? databasemetadata() // --> '{"purpose":"Documentation Test Database","owner":"Yvonne Milne"}'