The mgiModifyDatabase Tag

Tag Behavior

Use the mgiModifyDatabase tag to modify a database without the web-based interface (see also mgiEditDatabase)


Tag Syntax

The mgiModifyDatabase tag has eleven modes. Each mode has different required and optional parameters. The modes of mgiModifyDatabase are:

Return to the mgiModifyDatabase Mode Menu | Examples and Output | Suggested Usage

ListDatabases Mode

The listDatabases mode of the mgiModifyDatabase tag has one required parameters and four optional parameters. The tag form is:

<mgiModifyDatabase mode="listDatabases" 
resultVariableName="Variable Name" odbcDatasource="Source Name" 
odbcUsername="Name" odbcPassword="Password">

Required parameters:

  • mode - The mode is the function that the mgiModifyDatabase tag performs. In "listDatabases" mode, the mgiModifyDatabase tag displays a comma delimited list of database names in the region.

Optional Parameters:

  • resultVariableName - The resultVariableName is the name prepended to result variables that contain information about the operation. You may choose any name for the result variable prefix. To display result variables use the mgiGet tag. In the following list of available result variables, the resultVariableName value is "resultvar". Result variables are created and available anywhere on the page after the mgiModifyDatabase tag.
    • resultvar_ResultCount - A page variable containing the total number of databases in the list.
  • 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, database information will be stored, modified and/or deleted from 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.

Return to the mgiModifyDatabase Mode Menu | Examples and Output | Suggested Usage

CreateDatabase Mode

The createDatabase mode of the mgiModifyDatabase tag has two required parameters and four optional parameters. The tag form is:

<mgiModifyDatabase mode="createDatabase" databaseName="Name" 
resultVariableName="Variable Name" odbcDatasource="Source Name" 
odbcUsername="Name" odbcPassword="Password">

Required parameters:

  • mode - The mode is the function that the mgiModifyDatabase tag performs. In "createDatabase" mode, the mgiModifyDatabase tag creates a new database.
  • databaseName - The databaseName is the name of the database to create.

Optional Parameters:

  • resultVariableName - The resultVariableName is the name prepended to result variables that contain information about the operation. You may choose any name for the result variable prefix. To display result variables use the mgiGet tag. In the following list of available result variables, the resultVariableName value is "resultvar". Result variables are created and available anywhere on the page after the mgiModifyDatabase tag.
    • resultvar_DatabaseName - A page variable that contains the name of the database in case it was modified by the server.
  • 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, database information will be stored, modified and/or deleted from 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.

Return to the mgiModifyDatabase Mode Menu | Examples and Output | Suggested Usage

DeleteDatabase Mode

The deleteDatabase mode of the mgiModifyDatabase tag has two required parameters and three optional parameters. The tag form is:

<mgiModifyDatabase mode="deleteDatabase" databaseName="Name" 
odbcDatasource="Source Name" odbcUsername="Name" 
odbcPassword="Password">

Required parameters:

  • mode - The mode is the function that the mgiModifyDatabase tag performs. In "deleteDatabase" mode, the mgiModifyDatabase tag deletes the specified database
  • databaseName - The databaseName is the name of the database to delete.

Optional Parameters:

  • 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, database information will be stored, modified and/or deleted from 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.

Return to the mgiModifyDatabase Mode Menu | Examples and Output | Suggested Usage

ListFields Mode

The listFields mode of the mgiModifyDatabase tag has two required parameters and four optional parameters. The tag form is:

<mgiModifyDatabase mode="listFields" databaseName="Name" 
resultVariableName="Variable Name" odbcDatasource="Source Name" 
odbcUsername="Name" odbcPassword="Password">

Required parameters:

  • mode - The mode is the function that the mgiModifyDatabase tag performs. In "listFields" mode, the mgiModifyDatabase tag displays the names of fields in the specified database. Fields are listed in the format "name.type.length.flags,name.type.length.flags,name.type.length.flags". For example,
field1.Text.25.X,field2.UInteger.0.XQ,field3.LongText.0.X
  • databaseName - The databaseName is the name of the database to search.

Optional Parameters:

  • resultVariableName - The resultVariableName is the name prepended to result variables that contain information about the operation. You may choose any name for the result variable prefix. To display result variables use the mgiGet tag. In the following list of available result variables, the resultVariableName value is "resultvar". Result variables are created and available anywhere on the page after the mgiModifyDatabase tag.
    • resultvar_ResultCount - A page variable that contains the number of fields found.
  • 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, database information will be stored, modified and/or deleted from 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.

Return to the mgiModifyDatabase Mode Menu | Examples and Output | Suggested Usage

AddField Mode

The addField mode of the mgiModifyDatabase tag has four required parameters and six optional parameters. The tag form is:

<mgiModifyDatabase mode="addField" databaseName="Name" 
fieldName="Field Name" fieldType="Type" 
fieldLength="Integer" fieldFlags="X/Q"
resultVariableName="Variable Name" odbcDatasource="Source Name" 
odbcUsername="Name" odbcPassword="Password">

Required parameters:

  • mode - The mode is the function that the mgiModifyDatabase tag performs. In "addField" mode, the mgiModifyDatabase tag creates a new database field in the specified database.
  • databaseName - The databaseName is the name of the database the field is added to.
  • fieldName - The fieldName is the name of the field to add.
    • 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.
    • 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.
  • fieldType - The fieldType is the type of field to add. Valid field types are Boolean, Integer, UInteger, Number, Text, LongText. See the mgiEditDatabase tag for field type descriptions.

Optional Parameters:

  • fieldLength - The fieldLength is the length of the field in characters if applicable to the field type.
  • fieldFlags - The fieldFlags are designations for indexed and unique fields. Valid flags are "X" for indexed and "Q" for unique.
  • resultVariableName - The resultVariableName is the name prepended to result variables that contain information about the operation. You may choose any name for the result variable prefix. To display result variables use the mgiGet tag. In the following list of available result variables, the resultVariableName value is "resultvar". Result variables are created and available anywhere on the page after the mgiModifyDatabase tag.
    • resultvar_FieldName - A page variable that contains the name of the field in case it was modified by the server.
  • 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, database information will be stored, modified and/or deleted from 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.

Return to the mgiModifyDatabase Mode Menu | Examples and Output | Suggested Usage

DeleteField Mode

The deleteField mode of the mgiModifyDatabase tag has three required parameters and three optional parameters. The tag form is:

<mgiModifyDatabase mode="deleteField" databaseName="Name" 
fieldName="Field Name" odbcDatasource="Source Name" 
odbcUsername="Name" odbcPassword="Password">

Required parameters:

  • mode - The mode is the function that the mgiModifyDatabase tag performs. In "deleteField" mode, the mgiModifyDatabase tag deletes a field from the specified database
  • databaseName - The databaseName is the name of the database the field is deleted from.
  • fieldName - The fieldName is the name of the field to delete.

Optional Parameters:

  • 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, database information will be stored, modified and/or deleted from 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.

Return to the mgiModifyDatabase Mode Menu | Examples and Output | Suggested Usage

AddRecord Mode

The addRecord mode of the mgiModifyDatabase tag has four of seven required parameters and three optional parameters. The tag form is:

<mgiModifyDatabase mode="addRecord" databaseName="Name" 
fieldName="Field Name" fieldValue="Value"
fieldName="Field Name" pageVariableName="Variable Name"
fieldName="Field Name" pathArgumentName="Path Argument Name"
fieldName="Field Name" postArgumentName="Post Argument Name"
odbcDatasource="Source Name" odbcUsername="Name" 
odbcPassword="Password">

Required parameters:

  • mode - The mode is the function that the mgiModifyDatabase tag performs. In "addRecord" mode, the mgiModifyDatabase tag adds a record to the specified database.
  • databaseName - The databaseName is the name of the database the record is added to.
  • fieldName - The fieldName is the name of the database field to populate. Multiple fieldName parameters may be included in one mgiModifyDatabase tag, but each fieldName parameter must be immediately followed by a fieldValue, pageVariableName, pathArgumentName or postArgumentName parameter that contains the value to populate the field.
  • fieldValue - The fieldValue is the value used to populate the field specified by the preceding fieldName parameter in the mgiModifyDatabase tag.
  • pageVariableName - The pageVariableName is the name of the page variable that contains the value used to populate the field specified by the preceding fieldName parameter in the mgiModifyDatabase tag.
  • pathArgumentName - The pathArgumentName is the name of the path argument that contains the valueused to populate the field specified by the preceding fieldName parameter in the mgiModifyDatabase tag.
  • postArgumentName - The postArgumentName is the name of the post argument that contains the value used to populate the field specified by the preceding fieldName parameter in the mgiModifyDatabase tag.

Optional Parameters:

  • 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, database information will be stored, modified and/or deleted from 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.

Return to the mgiModifyDatabase Mode Menu | Examples and Output | Suggested Usage

DeleteRecord Mode

The deleteRecord mode of the mgiModifyDatabase tag has two required parameters and eleven optional parameters. The tag form is:

<mgiModifyDatabase mode="deleteRecord" databaseName="Name" 
keyfieldName="Field Name" fieldValue="Value"
keyfieldName="Field Name" pageVariableName="Variable Name"
keyfieldName="Field Name" pathArgumentName="Path Argument Name"
keyfieldName="Field Name" postArgumentName="Post Argument Name" 
resultVariableName="Variable Name" odbcDatasource="Source Name" 
odbcUsername="Name" odbcPassword="Password" 
uniqueIDFieldName="Field">

or

<mgiModifyDatabase mode="deleteRecord" databaseName="Name" 
searchString="String" resultVariableName="Variable Name"
odbcDatasource="Source Name" odbcUsername="Name" 
odbcPassword="Password" uniqueIDFieldName="Field">

Required parameters:

  • mode - The mode is the function that the mgiModifyDatabase tag performs. In "deleteRecord" mode, the mgiModifyDatabase tag deletes records from the specified database.
  • databaseName - The databaseName is the name of the database to search.

Optional Parameters:

  • keyFieldName - The keyFieldName is the name of the database field to search for the record(s) to delete. Multiple keyFieldName parameters may be included in one mgiModifyDatabase tag, but each keyFieldName parameter must be immediately followed by a fieldValue, pageVariableName, pathArgumentName or postArgumentName parameter that contains the search criteria for that field. When multiple keyFieldName and value pairs are present, an AND search is performed to locate the record(s) to delete. To perform an OR search, you must use the searchString parameter. All records that match the key field search criteria are deleted.
  • fieldValue - The fieldValue is the search criteria for the preceding keyFieldName parameter in the mgiModifyDatabase tag.
  • pageVariableName - The pageVariableName is the name of the page variable that contains the search criteria for the preceding keyFieldName parameter in the mgiModifyDatabase tag.
  • pathArgumentName - The pathArgumentName is the name of the path argument that contains the search criteria for the preceding keyFieldName parameter in the mgiModifyDatabase tag.
  • postArgumentName - The postArgumentName is the name of the post argument that contains the search criteria for the preceding keyFieldName parameter in the mgiModifyDatabase tag.
  • searchString - The search string is a fully formatted search string containing the field names to search, the search criteria, and the search operations. If the searchString parameter is specified, the keyFieldName, pageVariableName, pathArgumentName, postArgumentName, orderByField, and reverseOrder parameters are ignored. Search strings should contain field name and search criteria in the format keyFieldName='criteria'. Valid operators are "=" (equals), ">" (greater than), "<" (less than), ">=" (greater than and equal to), and "<=" (less than and equal to). 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. By default, search results are in asending order (ASC). To reverse the order of results in a search string, specify descending order by including DESC after the ORDER BY field. You may not enter quotes ("") in the value of the search string parameter. The following are example search strings:
searchString="LastName='J*' OR LastName='L' 
AND Registration='Yes' ORDER BY CustID DESC"

searchString="FirstName='Ken' AND NOT LastName='Barker'
  • resultVariableName - The resultVariableName is the name prepended to result variables that contain information about the operation. You may choose any name for the result variable prefix. To display result variables use the mgiGet tag. In the following list of available result variables, the resultVariableName value is "resultvar". Result variables are created and available anywhere on the page after the mgiModifyDatabase tag.
    • resultvar_ResultCount - A page variable that contains the number of matching records that were deleted.
  • 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, database information will be stored, modified and/or deleted from 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.

Return to the mgiModifyDatabase Mode Menu | Examples and Output | Suggested Usage

UpdateRecord Mode

The updateRecord mode of the mgiModifyDatabase tag has two required parameters and ten optional parameters. The tag form is:

<mgiModifyDatabase mode="updateRecord" databaseName="Name" 
keyfieldName="Field Name" fieldValue="Value"
keyfieldName="Field Name" pageVariableName="Variable Name"
keyfieldName="Field Name" pathArgumentName="Path Argument Name"
keyfieldName="Field Name" postArgumentName="Post Argument Name" 
fieldName="Field Name" fieldValue="Value"
fieldName="Field Name" pageVariableName="Variable Name"
fieldName="Field Name" pathArgumentName="Path Argument Name"
fieldName="Field Name" postArgumentName="Post Argument Name"
resultVariableName="Variable Name"
odbcDatasource="Source Name" odbcUsername="Name" 
odbcPassword="Password">

or

<mgiModifyDatabase mode="updateRecord" databaseName="Name" 
searchString="String" resultVariableName="Variable Name"
odbcDatasource="Source Name" odbcUsername="Name" 
odbcPassword="Password">

Required parameters:

  • mode - The mode is the function that the mgiModifyDatabase tag performs. In "updateRecord" mode, the mgiModifyDatabase tag modifies existing records in the specified database.
  • databaseName - The databaseName is the name of the database to search.

Optional Parameters:

  • keyFieldName - The keyFieldName is the name of the database field to search for the record(s) to modify. Multiple keyFieldName parameters may be included in one mgiModifyDatabase tag, but each keyFieldName parameter must be immediately followed by a fieldValue, pageVariableName, pathArgumentName or postArgumentName parameter that contains the search criteria for that field. When multiple keyFieldName and value pairs are present, an AND search is performed to locate the record(s) to modify. To perform an OR search, you must use the searchString parameter. All records that match the key field search criteria are modified.
  • fieldName - The fieldName is the name of the database field to populate. Multiple fieldName parameters may be included in one mgiModifyDatabase tag, but each fieldName parameter must be immediately followed by a fieldValue, pageVariableName, pathArgumentName or postArgumentName parameter that contains the value to populate the field.
  • fieldValue - The fieldValue is the search criteria for the preceding keyFieldName or update criteria for the preceding fieldName parameter in the mgiModifyDatabase tag.
  • pageVariableName - The pageVariableName is the name of the page variable that contains the search criteria for the preceding keyFieldName or update criteria for the preceding fieldName parameter in the mgiModifyDatabase tag.
  • pathArgumentName - The pathArgumentName is the name of the path argument that contains the search criteria for the preceding keyFieldName or update criteria for the preceding fieldName parameter in the mgiModifyDatabase tag.
  • postArgumentName - The postArgumentName is the name of the post argument that contains the search criteria for the preceding keyFieldName or update criteria for the preceding fieldName parameter in the mgiModifyDatabase tag.
  • searchString - The search string is a fully formatted search string containing the field names to search, the search criteria, and the search operations. If the searchString parameter is specified, the keyFieldName, pageVariableName, pathArgumentName, postArgumentName, orderByField, and reverseOrder parameters are ignored. Search strings should contain field name and search criteria in the format keyFieldName='criteria'. Valid operators are "=" (equals), ">" (greater than), "<" (less than), ">=" (greater than and equal to), and "<=" (less than and equal to). 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. By default, search results are in asending order (ASC). To reverse the order of results in a search string, specify descending order by including DESC after the ORDER BY field. You may not enter quotes ("") in the value of the search string parameter. The following are example search strings:
searchString="LastName='J*' OR LastName='L' 
AND Registration='Yes' ORDER BY CustID DESC"

searchString="FirstName='Ken' AND NOT LastName='Barker'
  • resultVariableName - The resultVariableName is the name prepended to result variables that contain information about the operation. You may choose any name for the result variable prefix. To display result variables use the mgiGet tag. In the following list of available result variables, the resultVariableName value is "resultvar". Result variables are created and available anywhere on the page after the mgiModifyDatabase tag.
    • resultvar_ResultCount - A page variable that contains the number of matching records that were modified.
  • 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, database information will be stored, modified and/or deleted from 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.

Return to the mgiModifyDatabase Mode Menu | Examples and Output | Suggested Usage

Export Mode

The export mode of the mgiModifyDatabase tag has three required parameters and ten optional parameters. The tag form is:

<mgiModifyDatabase mode="export" databaseName="Name" 
fileLocation="File Path"
keyfieldName="Field Name" fieldValue="Value"
keyfieldName="Field Name" pageVariableName="Variable Name"
keyfieldName="Field Name" pathArgumentName="Path Argument Name"
keyfieldName="Field Name" postArgumentName="Post Argument Name" 
resultVariableName="Variable Name"
odbcDatasource="Source Name" odbcUsername="Name" 
odbcPassword="Password">

or

<mgiModifyDatabase mode="export" databaseName="Name" 
searchString="String" fileLocation="File Path" 
resultVariableName="Variable Name" odbcDatasource="Source Name" 
odbcUsername="Name" odbcPassword="Password">

Required parameters:

  • mode - The mode is the function that the mgiModifyDatabase tag performs. In "export" mode, the mgiModifyDatabase tag modifies exports records found in a search of the specified database.
  • databaseName - The databaseName is the name of the database to search.
  • fileLocation - The fileLocation is the relative path to the file where exported files are written. If the file exists, it's content will be overwritten. If the file does not exist, it will be created.

Optional Parameters:

  • keyFieldName - The keyFieldName is the name of the database field to search for the record(s) to export. Multiple keyFieldName parameters may be included in one mgiModifyDatabase tag, but each keyFieldName parameter must be immediately followed by a fieldValue, pageVariableName, pathArgumentName or postArgumentName parameter that contains the search criteria for that field. When multiple keyFieldName and value pairs are present, an AND search is performed to locate the record(s) to export. To perform an OR search, you must use the searchString parameter. All records that match the key field search criteria are modified.
  • fieldValue - The fieldValue is the search criteria for the preceding keyFieldName parameter in the mgiModifyDatabase tag.
  • pageVariableName - The pageVariableName is the name of the page variable that contains the search criteria for the preceding keyFieldName parameter in the mgiModifyDatabase tag.
  • pathArgumentName - The pathArgumentName is the name of the path argument that contains the search criteria for the preceding keyFieldName parameter in the mgiModifyDatabase tag.
  • postArgumentName - The postArgumentName is the name of the post argument that contains the search criteria for the preceding keyFieldName parameter in the mgiModifyDatabase tag.
  • searchString - The search string is a fully formatted search string containing the field names to search, the search criteria, and the search operations. If the searchString parameter is specified, the keyFieldName, pageVariableName, pathArgumentName, postArgumentName, orderByField, and reverseOrder parameters are ignored. Search strings should contain field name and search criteria in the format keyFieldName='criteria'. Valid operators are "=" (equals), ">" (greater than), "<" (less than), ">=" (greater than and equal to), and "<=" (less than and equal to). 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. By default, search results are in asending order (ASC). To reverse the order of results in a search string, specify descending order by including DESC after the ORDER BY field. You may not enter quotes ("") in the value of the search string parameter. The following are example search strings:
searchString="LastName='J*' OR LastName='L' 
AND Registration='Yes' ORDER BY CustID DESC"

searchString="FirstName='Ken' AND NOT LastName='Barker'
  • resultVariableName - The resultVariableName is the name prepended to result variables that contain information about the operation. You may choose any name for the result variable prefix. To display result variables use the mgiGet tag. In the following list of available result variables, the resultVariableName value is "resultvar". Result variables are created and available anywhere on the page after the mgiModifyDatabase tag.
    • resultvar_ResultCount - A page variable that contains the number of matching records that were exported.
  • 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, database information will be stored, modified and/or deleted from 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.

Return to the mgiModifyDatabase Mode Menu | Examples and Output | Suggested Usage

Import Mode

The import mode of the mgiModifyDatabase tag has three required parameters and four optional parameters. The tag form is:

<mgiModifyDatabase mode="import" databaseName="Name" 
fileLocation="File Path" resultVariableName="Variable Name"
odbcDatasource="Source Name" odbcUsername="Name" 
odbcPassword="Password">

Required parameters:

  • mode - The mode is the function that the mgiModifyDatabase tag performs. In "import" mode, the mgiModifyDatabase tag modifies imports record to the specified database.
  • databaseName - The databaseName is the name of the database to use.
  • fileLocation - The fileLocation is the relative path to the file to import.

Optional Parameters:

  • resultVariableName - The resultVariableName is the name prepended to result variables that contain information about the operation. You may choose any name for the result variable prefix. To display result variables use the mgiGet tag. In the following list of available result variables, the resultVariableName value is "resultvar". Result variables are created and available anywhere on the page after the mgiModifyDatabase tag.
    • resultvar_ResultCount - A page variable that contains the number of matching records that were imported.
  • 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, database information will be stored, modified and/or deleted from 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.

Return to the mgiModifyDatabase Mode Menu | Examples and Output | Suggested Usage


Example Usage and Output

<mgiModifyDatabase mode="listDatabases">

In this example, all databases in a region (including internal MGI databases) are listed in a comma-delimited format such as:

Books,_MGIDB_Authentication_,_MGIDB_Banner_Ads_
<mgiModifyDatabase mode="addRecord" databaseName="Contacts"
fieldName="Name" postArgumentName="fullName"
fieldName="Address" postArgumentName="streetAddress"
fieldName="City" postArgumentName="city"
fieldName="State" postArgumentName="state"
fieldName="Zip" postArgumentName="zipCode"
fieldName="Phone" postArgumentName="phoneNumber"
fieldName="Email" postArgumentName="emailAddress">

In this example, a contact is added to the "Contacts" database from a form submission.


Suggested Usage

  • Form-Based Database Modifications


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


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