Connection - Maple Programming Help

Home : Support : Online Help : Connectivity : Database Package : Connection : Database/Connection/GetSchemas

Connection

 GetSchemas
 get a list of schemas from the database

 Calling Sequence connection:-GetSchemas( opts )

Parameters

 connection - Connection module opts - (optional) equation of the form output=value

Description

 • GetSchemas returns an Array in which each row of the Array contains matches from one schema in the database connected to using connection.  A column in the Array is data associated with the table.  The output option controls the columns and their order in the returned Array.
 • A schema in a database is similar to a namespace.  Objects that use different schema and have the same name are distinct.
 • The opts argument can contain the following equation.
 output = list containing one or both literal symbols name and catalog
 The output option specifies the columns of information to return and their order. By default, only the name is returned.
 - name returns the name of the schema.
 - catalog returns the name of the catalog that uses the schema.

Examples

 > $\mathrm{driver}≔\mathrm{Database}[\mathrm{LoadDriver}]\left(\right):$
 > $\mathrm{conn}≔\mathrm{driver}:-\mathrm{OpenConnection}\left(\mathrm{url},\mathrm{name},\mathrm{pass}\right):$$\mathrm{conn}:-\mathrm{GetSchemas}\left(\right)$
 $\left[\begin{array}{c}{"Schema1"}\\ {"Schema2"}\\ {"Schema3"}\end{array}\right]$ (1)
 > $\mathrm{conn}:-\mathrm{GetSchemas}\left('\mathrm{output}'=\left['\mathrm{catalog}','\mathrm{name}'\right]\right)$
 $\left[\begin{array}{cc}{"Database1"}& {"Schema1"}\\ {"Database1"}& {"Schema2"}\\ {"Database2"}& {"Schema3"}\end{array}\right]$ (2)