MarkLogic 9 Product Documentation
view:schema-create

view:schema-create(
   $schema-name as xs:string,
   $permissions as item()*
) as xs:unsignedLong

Summary

This function creates a new relational schema in the Schema database. The schema id is returned. Every SQL deployment must include a default schema, called "main," as shown in the example below.

This schema is typically created for Range Views. However, such a schema can also contain Template Views. Note that Range Views cannot be created in a schema created by a Template View.

Parameters
schema-name The schema name. The schema name must be unique. A valid schema name is a single word that starts with an alpha character. The schema name may contain numeric characters, but cannot contain punctuation or special characters.
permissions Permissions that control access to the schema. If no permissions are specified, the default permissions are used. When run in an XQuery context, the permissions are a sequence of XML elements (sec:permission). When importing this module into a Server-Side JavaScript context, the permissions are an array of Objects.

Example

  xquery version "1.0-ml"; 
 
  import module namespace view = "http://marklogic.com/xdmp/view" 
      at "/MarkLogic/views.xqy";
 
  view:schema-create("main", ())

  (: Create a new schema, named 'main', using the default permissions. :)
     
Powered by MarkLogic Server | Terms of Use | Privacy Policy