The mgiEditDatabase Tag

Tag Behavior

Use the mgiEditDatabase tag to create, modify and delete custom databases via a web-based interface.


Tag Syntax

The mgiEditDatabase tag has no required parameters and nine optional parameters. The tag form is:

<mgiEditDatabase mode="Mode" databaseName="Database" 
showMGIDatabases="Yes/No" advancedSearch="On/Off" 
mirrorButtons="Yes/No" uniqueIDFieldName="Field" 
odbcDatasource="Source Name" odbcUsername="Name" 
odbcPassword="Password">

Required Parameters:

  • None.

Optional Parameters:

  • mode - The mode is the function that the mgiEditDatabase tag performs. In "manageFields" mode, the mgiEditDatabase tag displays the web-based interface for creating and deleting database fields. In "manageRecords" mode, the mgiEditDatabase tag displays the web-based interface for creating, modifying and deleting database records. If the mode parameter is not included, then buttons for managing fields and managing records are displayed in the interface. The databaseName parameter is required if you include the mode parameter.
  • databaseName - The databaseName is the name of the database to manage. If the databaseName parameter is not included, then all databases in the region are displayed. The databaseName parameter is required if you include the mode parameter.
  • showMGIDatabases - The showMGIDatabases parameter determines if databases used internally by MGI are displayed. If the showMGIDatabases parameter value is "Yes", then internal MGI databases are displayed. If the showMGIDatabases parameter value is "No", then internal MGI databases are not displayed. The default value is "No".
  • advancedSearch - The advancedSearch parameter determines if the advanced search field displays on the search screen of the edit database interface. If the advancedSearch parameter value is "On", then advanced search field displays. If the advancedSearch parameter value is "Off", then the advanced search field does not display. The default value is "Off". Search strings should contain field name and search criteria in the format keyFieldName='criteria'. Field name and search criteria pairs should be separated by the search operator "AND", "OR", or "NOT". To order the results from a search string, include the order by field in the format ORDER BY keyFieldName. To reverse the order of results in a search string, specify descending order by including DESC. The following are example search strings:
"LastName='J*' OR LastName='L' 
AND Registration='Yes' ORDER BY CustID DESC"

"FirstName='Ken' AND NOT LastName='Barker'
  • mirrorButtons - The mirrorButtons parameter determines if the navigation and function buttons of the edit database interface are displayed at the top of the edit database screens. If the mirrorButtons parameter value is "Yes", then the buttons are displayed at the top and bottom of the edit database screens. If the mirrorButtons parameter value is "No", then buttons are displayed only at the bottom of the edit database screens. The default value is "No".
  • uniqueIDFieldName - The uniqueIDFieldName parameter is the name of the ODBC database field to use for a unique record value.
  • odbcDatasource (NT only) - The odbcDatasource is the name of datasource on the server that provides access information for an external ODBC database. If the odbcDatasource parameter is included, databases will be created and managed using the specified ODBC database rather than the internal MGI database. Inquire with the server administrator for additional information about the use of ODBC databases. If you include the odbcDatasource parameter, the odbcUsername and odbcPassword parameters are required.
  • odbcUsername (NT only) - The odbcUsername is the username required to access the ODBC datasource. The odbcUsername parameter is required if you include the odbcDatasource parameter.
  • odbcPassword (NT only) - The odbcPassword is the code required to access the ODBC datasource. The odbcPassword parameter is required if you include the odbcDatasource parameter.


Technical Notes

  • Field Name Length Limit - The length of field names in the internal MGI database is limited according to the type of field and operating system. All field names that are not indexed are limited to 63 characters. The limit for non-indexed field names applies to all operating systems. Indexed field names on Macintosh operating systems 9.04 and prior are limited to 25 characters. Indexed field names on all supported Windows operating systems are limited to 63 characters.
  • Field Name Characters - The characters allowed in database field names for the built-in MGI database are alpha-numeric characters (i.e., letters and numbers), underscores (_), hyphens (-), and spaces. When adding a field, any non-allowed characters in the field name are automatically replaced with an underscore.
  • Field Types - Database fields types are specified when you create each field. The following is a description of each field type. Fields can be designated as indexed and/or unique. A field must be indexed in order to search for information in the field (in the mgiEditDatabase admin or using mgiSearchDatabase) or order search results by the field. A unique field will not allow two records to contain the same value in that field (even if the value is a blank field).
    • Whole Number (Integer) - A whole number field can contain only positive and negative whole numbers without decimals.
    • Positive Number (UInteger) - A positive number field can contain only positive whole numbers.
    • Multi-precision Number - A multi-precision number field can contain up to 50 significant digits (including decimal positions) and supports the concept of a NULL number (a blank number that is not defaulted to 0). When this field is created, the scale (i.e., the number of digits to the right of the decimal point) is specified. The maximum scale is 25. The multi-precision field type does not suffer from the usual rounding errors that are common when dealing with floating point numbers.
    • True/False (Boolean) - A boolean field can contain the values "True" or "False" to discriminate records.
    • Text - A text field can contain up to 250 alpha-numeric characters. The maximum length can be specified during field creation, but defaults to 25 if not specified.
    • Long Text - A long text field can contain text that is greater than 250 alpha-numeric. Search results cannot be ordered by long text fields.
  • Indexed Field Limit - You may create unlimited fields, but only 31 fields may be indexed.
  • Record Data Limit - Each database record can hold a maximum of 64 KB of data across all fields.


Example Usage and Output

<mgiEditDatabase>

In this example, the mgiEditDatabase tag would display the web-based database interface with all databases in the region listed and with options to modify fields and modify records.


Suggested Usage

  • Databases


[Understanding MGI Menu] [Using MGI Menu] [Referencing MGI Menu]


[MGI Guides Main Menu] [User Guide Main Menu]