Generate Referential Integrity Scripts

For some database systems, you can have the DBMS (instead of Uniface) manage referential integrity. To do so you need to generate referential integrity scripts and have the database administrator execute those scripts in the target database.

  1. In the Uniface assignment file (by default dbms.asn), add the DBMS connector declaration and parameters for your target DBMS.
    [DRIVER_SETTINGS]
    ;settings used for Uniface Repository:
    SLE     U1.0
    USYS$SLE_PARAMS create db = on, identifiers = quoted
    
    ;settings used for target application database:
    MSS     U5.2
    USYS$MSS_PARAMS identifiers = quoted, procedures=on

    For more information, see Configuring the Database Connector.

  2. On the IDE command line, specify /genSql createReferentialIntegrity (or createRI) followed by the entity profile and target database connector. For example:

    ide.exe /gensql createRI *.sales mss

    If you are generating scripts for the Uniface Repository, use the /meta switch. For example:

    ide.exe /gensql /meta createRI *.dict mss

    For more information, see /genSql.

  3. Similarly, generate validation scripts using the validateReferential Integrity (or validateRI) option. For example:

    ide.exe /gensql validateRI *.sales mss
    ide.exe /gensql /meta validateRI *.dict mss
  4. Optionally, generate scripts to drop database referential integrity using the option dropReferentialIntegrity (or dropRI). For example:

    ide.exe /gensql dropRI *.sales mss
    ide.exe /gensql /meta dropRI *.dict mss
  5. Have the database administrator run the generated SQL command file using the DBMS. For more information, see Implement Referential Integrity in the Database and the connector documentation for your DBMS connector.

Related Topics