Advanced configuration for Progress OpenEdge

Optional features of the Progress OpenEdge drivers, each with its own settings.

Advanced configuration for Progress OpenEdge

Optional features of the Progress OpenEdge drivers, each with its own settings.

Advanced Features for Progress Connections: Distributed Databases, Array Fields, and Database Triggers

Our Progress SQL-89 ODBC Drivers support a number of advanced features (referred to collectively as "Tableview" features) through the use of a custom "Data Dictionary File."


Tableview configuration cannot be supported in our SQL-92 drivers, due to changes made in the Progress Software components. Some features are still supported through different methods; others simply cannot be re-implemented (as of this writing).

Distributed Databases

This is the most common reason users need to configure Tableview features, with the SQL-89 drivers. There is no special configuration required here; just the basic Tableview Setup (below).

Due to changes made in the Progress database engine between their SQL-89 and SQL-92 engines, JOINs over multiple Progress databases (i.e., multiple .db files) cannot be executed over a single SQL-92 mode ODBC connection against Progress OpenEdge 9.1x, 10.x, and later

According to the Progress SQL-92 documentation:

An application can connect to more than one database at a time, with a maximum of 10 connections. However, the application can actually gain access to only one database at a time. The database name specified in the CONNECT statement becomes the active one.

For this reason, if you need to make such queries, OpenLink recommends you

  • run Progress 9 in SQL-89 mode (perhaps in combination with SQL-92 mode; this "hybrid" operation is the default for Progress 9.x), and use the appropriate SQL-89 driver, permitting execution of these JOINs in the traditional manner; or
  • use Virtuoso and multiple single-DB SQL-92 connections to unify the Progress databases into a single Virtuoso schema, against which the JOINs may be executed.

Array Fields

Array fields are the second-most common reason users need to configure Tableview features. There is again no special configuration required with the SQL-89 drivers; just the basic Tableview Setup (below).

Progress array fields are not supported via the SQL-92 engine the same way they are via the traditional SQL-89 interface drivers.

Progress tables with array fields cannot be created while connected to the SQL-92 engine; however, array fields previously created using the SQL-89 driver may be accessed via the SQL-92 engine.

From a technical perspective, the array field is mapped to a single variable character (VARCHAR) field, and the data is returned as a semicolon-separated list. Individual elements of the array may be accessed using three Progress functions within SQL Statements:

Progress function

Effect

PRO_ELEMENT This function allows one or more elements to be selected.
PRO_ARR_ESCAPE This function simplifies escaping special characters when updating an array field.
PRO_ARR_DESCAPE This function removes escape characters from elements selected from an array field.

For more information on this topic, visit Appendix C, section 2, of the SQL-92 Guide and Reference, in the Progress 9 documentation. (Exact location will be different in Progress OpenEdge documentation.)

Progress Database Triggers

Progress Database Triggers are only supported over SQL-89-based connections. The SQL-92 engine has completely changed the way Progress Triggers work.

Important: To make use of Progress Database Triggers, the Logical Database Name to which your Triggers have been compiled must match the value provided to the "-ld" parameter when setting the Progress Database Connect options during the execution of "setup.p".

If you have compiled your triggers against a database physically identified as "/usr/progress/demo.db" but logically identified as "mydemo", your "setup.p" Database Connection String (used below) would be:

Example
/usr/progress/demo -ld mydemo

Setting Up Tableview Functionality for SQL-89 Connections

This custom "Data Dictionary File" is built by running the OpenLink-provided Progress Program File "setup.p" found in the "bin" sub-directory below the OpenLink base installation directory. Follow the instructions for your platform --

  • Unix Host
  • Windows Host

Once the setup.p script has been run, follow the instructions to configure your driver type to use the resulting tableview.pf and tableview.dat files:

  • Single-Tier
  • Multi-Tier

Advanced Tableview Configuration

Working with Multiple Sets of Tableview Configuration Files (Multi-Tier Only)

Troubleshooting Common Tableview Problems

setup.i Enforces 255 Char Field Limit
Tableview Default allows only 5 databases

Creating Custom Relink Scripts for Drivers and Agents for Progress/ OpenEdge

Custom relink scripts may be needed when our standard scripts are incompatible with your database installation and/or environment. The Progress probuild utility enables you to create such custom scripts.

  1. Locate the buildenv script, typically found in the $DLC/probuild/eucapp directory.
  2. Ensure that the environment variable settings in the buildenv script are accurate for your system.
  3. Set and export

    Example
    PROLOAD=$DLC/probuild
    export PROLOAD

  4. Type the following command at your command line:

    Example
    $PROLOAD/eucapp/probuild

  5. At the Install Link Script Into prompt, enter the full path to your ~/openlink/bin directory.
  6. Click Continue.
  7. Select ESQL/C Large Client Full from the product list.
  8. Click Continue.
  9. Give your relink script an appropriate name. For example:

    Example
    ldpro7
    ldpro8
    ldpro9

  10. Give the executable to be produced an OpenLink-style Database Agent name. For example:

    Example
    pro73e_sv
    pro83b_sv
    pro91b_sv

  11. Click Continue.
  12. Do not specify any special configurable elements.
  13. Click Continue.
  14. Locate the database agent object code in the /lib sub-directory of your OpenLink installation. Object code files are named similarly to pro7_sv.o, pro8_sv.o, and pro9_sv.o.
  15. Enter the full path to the relevant Database Agent object code (proxxx_sv.o) under "Object Files.'
  16. Click Continue.
  17. Exit probuild.
  18. Repeat the relink process with your new relink script.
Relinking Multi-Tier Database Agents for any DBMS

It is sometimes necessary to link or re-link your Multi-Tier Database Agents. Typical reasons include:

  • The existing Database Agent executable has some incompatibility with database or operating system libraries on your Broker host.
  • No Database Agent executable was installed on your Broker host.

The files described below should all be part of all current agent installations. If the files discussed below are not found in your installation, you may have an older version of the software. In that case, please contact us for additional assistance.

We provide a relink script for each Database Agent. These scripts are named using the form -- <ld><XXXX><NN>[mv].

  • ld - indicates a link script
  • XXXX - first 3 or 4 letters of database name
  • NN - database version number, to the same specificity as the corresponding Database Agents
  • mv - if the agent is multi-threaded.

Examples:

  • ldora81mv is for the multi-threaded agent for Oracle 8i.
  • ldoig2 is for the single-threaded agent for Ingres II.

We have attempted to provide a set of generic link scripts for every version of Progress we support, to enable you to relink most easily. In some cases, you may need to create a custom relink script for Progress Agents. Note: Relinking Progress Agents is typically necessary only if you are running a version of Progress with a different patch level the one originally used for linking the agents shipped and you are connecting a SQL-89 Agent in shared memory mode.


Pre-requisites for relinking Database Agents

Requirements for all Database Agents

  • Make a backup copy of your existing Agent(s).
  • Insure that you have a C compiler and library linker installed on your database server.
  • Set key OpenLink linking-script environment variables, which themselves reference key database environment variables required for making native connections to your database engine. You may prefer to adjust these values in the "dbpaths" file situated in the same directory as your database agent link script.
    • DB2

      INI
      DB2DIR=$DB2INST

    • Informix

      INI
      INFORMIX5DIR=$INFORMIXDIR
      INFORMIX6DIR=$INFORMIXDIR
      INFORMIX7DIR=$INFORMIXDIR

    • Ingres

      INI
      INGRES6DIR=$II_SYSTEM/ingres
      INGRES7DIR=$II_SYSTEM/ingres

    • Oracle

      INI
      ORACLE6DIR=$ORACLE_HOME
      ORACLE7DIR=$ORACLE_HOME
      ORACLE8DIR=$ORACLE_HOME

    • Progress / OpenEdge

      Shell
      export PROGRES8DIR=$DLC
      export PROGRES9DIR=$DLC
      export PROGRES10DIR=$DLC

    • Solid

      INI
      SOLIDDIR=$SOLID

    • Sybase

      INI
      SYBASE10DIR=$SYBASE
      SYBASE11DIR=$SYBASE
      SYBASE4DIR=$SYBASE

    • Unify

      INI
      UNIFYDIR=$UNIFY../lib

    • Velocis

      INI
      VELOCISDIR=$VELOCIS

    • Virtuoso

      INI
      VIRTUOSODIR=$VIRTUOSO

  • The ".../openlink/lib" (or similar) subdirectory that you are working with should be included in your system PATH. If it is not already, add this directory to the system PATH now.

Additional Informix-specific requirements

  • Informix users must have an $INFORMIXDIR/lib/esql/ directory for successful relinking. This may be obtained and installed as part of the freely downloadable Informix Client SDK, available from IBM, if not already present as part of your installation.

Additional Progress-specific requirements

  • All Progress users must have a $DLC/probuild/4gl/ directory, which requires a development license from Progress.
  • All Progress users must set and export DLC and PROLOAD environment variables. DLC points to the root of the Progress installation. PROLOAD points to the $DLC/probuild/ directory.
  • Progress 6 users must have an HLI/C license from Progress. For Progress 7, 8, and 9, this is not required

Relinking Database Agents for all DBMS

  1. Ensure that all pre-requisites listed above have been addressed.
  2. Navigate to the "lib" sub-directory of your OpenLink server components installation directory, e.g., "/usr/openlink/lib".
  3. If relinking a SQL-89 Agent for Progress (proNNN_sv) --
    1. Confirm that the Progress environment variable DLC is set correctly.
    2. Confirm that the Progress environment variable PROLOAD is set correctly.
    3. Run the appropriate mkdlcX script, where X is the major version number of your Progress installation (i.e., 6, 7, 8, or 9). This will produce a file called dlcX.o.
    4. If you receive an error stating that any Progress library cannot be found, edit the mkdlcX script and remove the reference(s) to that file; then re-run the mkdlcX script. Repeat this step as needed.
  4. Run the appropriate link script (ldXXXNN) which will attempt to build a new database agent.
  5. At the end of the relink process, the new database agent executable will be automatically placed in the "bin" subdirectory directory of your OpenLink server components installation. The new database agent binary will be named according to the typical OpenLink conventions, i.e., XXXNN_sv or XXXNN_mv.
  6. Navigate to the "lib" sub-directory of your OpenLink server components installation; typically --

    Shell
    cd ../bin

  7. Locate your newly linked agent. If it has a different name than the original agent, you can rename both so that the new one takes the place of the old, or you can edit your Broker Rulebook (oplrqb.ini) and change all occurrences of the old database agent name to the new agent name.
  8. Restart your Broker.
  9. Test.

Related

Progress Microsoft Access Compatibility Configuration

Please ensure that you have the following OpenLink Settings enabled :

Client
  • OpenLink ODBC DSN "No login dialog" check box is checked
  • Using the OpenLink Client Configuration Utility (if present) or the Registry Editor, ensure that ShowErrors is off. (If using the Registry Editor, drill down to \Local Machine\Software\ODBC\OPENLINK.INI\Communications, and set the ShowErrors key value to "No".) This prevents modal alert dialogs regarding error messages from the OpenLink communications layer.
Server
  • Ensure the following two lines come first in the [Mapping Rules] section of your Broker Rulebook (e.g., oplrqb.ini):

    INI
    [Mapping Rules]
    ;*:*:blank:*:*:*:rw = reject You should specify a username and password
    *:*:Admin:*:*:*:rw = reject User Admin Account Does Not Exist In Your Progress Database

    The above removes dependency on JetTryAuth or TryJetAuth.
Migrating from Progress SQL-89 Connectivity to SQL-92 Connectivity

Migrating from Progress SQL-89 connectivity (Progress 7.x through 9.1x) to SQL-92 connectivity (Progress 9.1x through OpenEdge 10.x and beyond) presents many challenges. This is especially the case as more and more organizations move to Progress OpenEdge 10.x and newer. These challenges apply to all data access mechanisms -- ODBC, JDBC, OLE DB, ADO.NET, etc.

With proper planning, most known challenges are quickly and easily resolvable. (Some challenges do require more time and effort than others!)

This guide advises you of some of the hurdles ahead and shows you how to properly plan for them and troubleshoot them.

Challenges

Data access challenges presented by Progress SQL-92 connectivity include --

  • All Shared Memory connectivity is replaced with TCP (i.e., "Sockets") connectivity.

  • All SQL-92 connections require a username and password (though the password may be blank). This username may be an entry in the Progress _User table or in sysprogress, or, if no database users have been set up, the username of the operating system user that created (or now owns) the database file, e.g., isports.db.

  • Unqualified identifiers (e.g., tablename vs owner.tablename) may result in errors unless/until extra steps are taken.

  • Tableview configuration is no longer available. This impacts --
    • Distributed Databases -- An ODBC DSN targeting Progress 9 through OpenEdge 10.1A can only work with one Progress database (one .db file) at a time. USE dbname and similar functionality can still change the target from one database to another within that connection, but JOINs across Progress "distributed databases" (multiple .db files) are not possible over a single ODBC connection.
      • Note Progress has re-enabled JOINs over Distributed Databases as of OpenEdge 10.1B. As of this writing, we are testing this functionality in our drivers, and will update documentation as soon as this is fully supported.
    • Array Fields -- Array data cannot be accessed using SQL-89 syntax (i.e., field@1, field@2, etc.). New SQL-92 syntax is available, but is more complex to work with.
    • Progress trigger support is not available through SQL-92 connections.
    • Progress Data Dictionary (schema) definitions of data fields with content exceeding their specified length must be adjusted.

Prerequisites

To move forward with SQL-92 connectivity, you need to do the following on the Progress host:

If you are using our Single-Tier "Lite" Drivers, Progress® SQL-92 Client Access must be installed and functional on the same machine as our driver.

Choosing between SQL-89 and SQL-92 Connectivity

We support both SQL-89 and SQL-92 connections wherever possible.

If you are a veteran OpenLink user, you may be familiar with our SQL-89 drivers, which have letter-version-specific branding in their product names, e.g., "Multi-Threaded Database Agent for Progress 8.2A" and "Multi-Threaded ODBC Driver for Progress 9.1D."

Our SQL-92 drivers are only major-version-specific, e.g., "Multi-Threaded Database Agent for Progress 9 (SQL-92)" and "Multi-Threaded ODBC Driver for Progress 10 (SQL-92)."


Q.What is the difference between the 10.0A (SQL-89) and 10.0 (SQL-92) options in the Download Wizard?

A. OpenLink's Development Team endeavored to make SQL-89-based drivers for OpenEdge 10.x. This was possible on a limited number of operating systems, and only with very early versions of Progress OpenEdge 10.0A; later patches disable the required Progress features. These products appear in our download wizard with a "10.0A (SQL-89)" branding.

The "10.0 (SQL-92)"-branded links lead to SQL-92-based installers suitable for use with all Progress OpenEdge 10.x instances.

Installing Data Access Drivers for Progress (SQL-92)

Follow the installation instructions for your new drivers, as normal.

Verifying the Multi-Tier Database Agent for Progress 10 (SQL-92)

If you are using our Multi-Tier Drivers, you should verify your Progress 10 SQL-92 Database Agent's functionality. Our Database Agents should return version and usage information in any environment that is properly configured. Failure to return version and usage information usually reveals environment or compatibility issues that should be addressed before continuing on.

  1. Log into the machine that hosts your Multi-Tier server components installation.
  2. Open an MS-DOS command prompt or Unix terminal session.
  3. cd into the bin sub-directory of the OpenLink installation, e.g., cd /opt/openlink/bin.
  4. Execute this command:

    Shell
    ./prs100_mv -?

  5. You should see output similar to the following:

    Example
    Progress 10 Database Agent
    Version 1.11 as of Wed Apr 29 2009 (Release 6.2 cvsid 00090).
    Compiled for Linux 2.6.9-78.0.13.EL (i686-generic-linux-glibc23-32)
    Copyright (C) OpenLink Software.
    Usage:
    pro100a_sv [-CmijrlLd] [+noautocommit] [+maxrows num] [+initsql arg]
    [+jetfix] [+norowsetlimit] [+loglevel num] [+logfile arg]
    [+debug]
    +noautocommit    turn autocommit off by default
    +maxrows         maximum allowed rows to fetch
    +initsql         execute SQL from this file for every connection made
    +jetfix          Jet Engine Compatibility Features
    +norowsetlimit   turn off rowset size limit
    +loglevel        log level
    +logfile         log file
    +debug           debug mode

    If the agent fails to return the desired output, use our Error Messages reference guide to troubleshoot your problem.

Error: error while loading shared libraries: libesql92.so: cannot open shared object file: No such file or directory.

This is the most common error produced by our agent during functionality verification. This error occurs when the Progress lib sub-directory is not found in the relevant shared library environment variable -- LD_LIBRARY_PATH, LIBPATH, or SHLIB_PATH on Unix, or PATH on Windows.

Resolution: Simply add the directory path(s) to the environment variable(s).

Troubleshooting Progress SQL-92 Connectivity

Initial SQL-92 connection attempts to Progress are often unsuccessful. However, the errors are almost always easily resolvable. Use these guidelines to troubleshoot any problems that arise in your environment:

  • The shared memory is version <some number>; expected <some number> (1178)
  • Invalid Packet Length
  • Invalid user name[SQLSTATE:285890Invalid Auth Specs]
  • Disconnected from server because database name was incorrect. (437)
  • Remote Database Name not valid.
  • Server did not respond[SQLSTATE:k0k130Progress Open SQL network interface]
  • Server's received count 1 does not equal client(1)'s send count 16777216.

Troubleshooting Progress SQL-92 Queries

  • Table/View/Synonym not found (7519)
  • Column "x" cannot be found or is not specified for query. (13865)
  • Failure getting record lock on a record from table
  • Invalid column name: field@1
Multi-Tier Installation and Configuration Guide for use with Epicor (formerly Activant) Prophet 21

Prophet 21 ships as an AIX server, which contains a Progress database and our Multi-Tier server components.

Note: For several years, Prophet 21 has included a deprecated version (typically Release 3.x or 4.x) of the Multi-Tier server components. We strongly recommend upgrading these to the latest available version (Release 5.x or later) for the Progress engine in your Prophet 21 installation. If you choose to upgrade, the rest of this page may be ignored; our general instructions are sufficient.

It is important that the Release version of the Multi-Tier Generic Client (ODBC, JDBC, or ADO.NET) components on your client host match the Release version of the Multi-Tier server-side components as closely as possible. Using Clients from one major Release (e.g., 5.x) against Broker/Agent from another major Release (e.g., 3.x) is neither tested, recommended, nor supported. We have made major changes in data type handling, among other things, which may lead to unpredictable and undesirable results when using such mixes of component versions.

Determine the version of the existing Multi-Tier components

  1. Access your AIX server's command line.
  2. Run these commands:

    Shell
    cd /usr/lpp/p21pro/openlink         [ENTER]
    ./oplrqb -?                         [ENTER]

  3. Note the Release, Version, and CVSID information returned. For example:

    Example
    OpenLink Request Broker
    Version 2.19 (Release 4.1) as of Wed Sep 05 2001 (cvsid 00059).

Obtain the Multi-Tier Client Installer

Note: Some client operating systems (e.g., Windows 7, Windows Server 2008, all 64-bit Windows) are not and will not be supported by the deprecated Release 3.x and 4.x Multi-Tier Clients matching the server components typically pre-installed on Prophet 21 machines. If your client operating system is among these, you must upgrade the server components to the latest available version for the Progress engine in your Prophet 21 installation. Once you upgrade, the rest of this page may be ignored; our general instructions are sufficient.

  1. Open a Support Case through our online Support Center. There is no charge for using this system.
  2. Answer the questions on the form as best you can. Guess if necessary, but please tell us you did so.
  3. In the Problem Description box, be sure to include the Request Broker release, version, and cvsid information you discovered above, and request the matching client components for the data consuming client OS.
  4. Wait (typically less than one business hour) for our Support Team to provide you with download links and other relevant information.

Install the Multi-Tier Client Components

  1. Download the client ZIP archive onto your Windows client.
  2. Use Winzip to extract the contents.
  3. Find the extracted Disk1 folder.
  4. Run setup.exe found inside Disk1.
  5. Choose a Quick Client Install.

Configure and test the Multi-Tier Client

  1. Open the Windows Control Panel.
  2. Open the Administrative Tools subfolder, if present.
  3. Open the Data Sources (ODBC) utility.
  4. Click on the System DSN tab.
  5. Click Add.
  6. Select the OpenLink Generic 32 Bit Driver from the driver list box.
  7. Click Finish.
  8. Set the following values in the ODBC DSN Setup screen:
    • Name — ActivantP21 (This is an arbitrary name; you can change it however you like.)
    • Domain — Progress 8
    • Hostname — the DNS-resolvable hostname or IP address of the P21 database host, e.g., 192.168.123.231 or p21host.example.com
    • Database Name — the full path to the P21 Progress database file, e.g., /usr/lpp/p21pro/db/gate.db
    • Username — usually blank, but may need to be a Progress username
    • Leave all other fields blank.
  9. Click the Test Connection button.
Advanced DSN Configuration for Epicor (formerly Activant) Prophet 21 users

"Domain" values

Historically, P21 DSNs used the Release 3.x Multi-Tier Generic Client, and passed Progress 8 in the Domain field.

Release 4.x and later Multi-Tier components use more specific Domain values, like Progress 83B. If the wrong Domain value is set, you may receive "Broker is unable to resolve your request" errors. This error is discussed elsewhere in our knowledgebase.

If you cannot determine the correct Domain value to use, open a Support Case through our online Support Center, and we will assist you. There is no charge for using this system.

"Hostname" values

The Hostname field passes the DNS-resolvable hostname or IP address of the P21 database host (e.g., p21.example.com, 192.168.123.231).

If there is some doubt about the hostname or IP address to use in the DSN, you can usually access the AIX command-line and execute this simple command:

Example
hostname


This should generally return the information that you need. However, the hostname command may have been re-aliased in such a way that it returns inappropriate information.

If you can not determine the correct IP address or hostname, open a Support Case through our online Support Center, and we will assist you. There is no charge for using this system.

Working with the entire P21 database schema

You should generally pass the full path to one Progress database in the Database field. Here are some examples relevant to P21 --

Files
/usr/lpp/p21pro/db/gate.db
/usr/lpp/p21pro/db/dyn.db
/usr/lpp/p21pro/db/gl.db
/usr/lpp/p21pro/db/stat.db

Along with some special C-ISAM data files, these comprise the Progress Distributed Database which is P21's data store.

You may actually want to connect to, and execute JOIN queries over, all these databases simultaneously. In that event, you should leave the database field blank. Instead, you will use Progress "Tableview" features.

Prophet 21 installations generally include a pre-generated Parameter File, /usr/lpp/openlink/dat/0/tableview.pf, and associated Data file, /usr/lpp/openlink/dat/0/tableview.dat, for this purpose.

The Parameter File is used by setting "Database Server", "Options", "Default Gateway," or some similar variant field (exact names vary depending on the Multi-Tier version) to -pf /usr/lpp/openlink/dat/0/tableview.pf. A related setting must also be made in the Broker Rulebook, oplrqb.ini, on the P21 database host.

If you have trouble establishing simultaneous connections to the distributed database or in working with some P21 tables, open a Support Case through our online Support Center, and we will assist you. There is no charge for using this system.

Username and Password values

P21 databases may or may not be secured with a username and password. (Progress databases tend not to be secured, but P21 sometimes implements a proprietary authentication.)

If you are unsure whether you need a username and password — or you do not know what the required values are — you must contact Epicor P21 Support. We cannot help you with passwords or related user authentication information.

Using Microsoft Access with Epicor (formerly Activant) Prophet 21 databases

The Prophet 21 database structure includes DYN, GL, STAT, GATE, and P21 tables.

The DYN, GL, and STAT tables are standard Progress database tables, and may be queried normally by any tool connecting through OpenLink data access drivers.

The P21 and GATE tables, however, are C-ISAM tables, which are inaccessible to many tools, including the Microsoft Access table-linking and query-building wizards. Fortunately, there are other ways to work with the data in the P21 tables, even with Microsoft Access.

Microsoft Access includes "Pass-Through Query" functionality. This lets you provide Microsoft Access with queries which will be passed directly to the back-end database.

You can manually construct such queries, if you're comfortable doing so. You can also use tools such as Microsoft Excel and Microsoft Query, which are both able to work with P21 tables, to graphically build and test queries. Once built, the text of these queries can be copied from the SQL view, and used with Microsoft Access or other tools which cannot work more dynamically with the C-ISAM tables.

The following steps will let you execute a "Pass-Through" query with Microsoft Access --

  1. Click to the Queries tab of the database dialog box.
  2. Click on New.
  3. Select Design View.
  4. Close the dialog box.
  5. In the Access menu bar, select Query -> SQL Specific -> Pass Through.
  6. Type or paste in your query.
  7. Click on the exclamation point (!) to run the query.
  8. Select the ODBC DSN which targets the P21 database.
  9. Provide authentication & click Connect.
Targeting the PUB schema through DSN connection attributes

When using SQL-92 drivers for Progress, you may find that queries using single-element identifiers which worked fine with the SQL-89 drivers, e.g., --

SQL
SELECT * FROM tablename

-- now require use of the PUB owner identifier, e.g., --

SQL
SELECT * FROM PUB.tablename


This is due to a number of changes in the underlying Progress layers, from SQL-89 to SQL-92.

Solution

This can generally be worked around by using our "Initial SQL" option.

This solution removes the need to prefix identifiers in new queries with "PUB.", but any queries which already include the prefix should continue to work just fine.

Simply create a text file, e.g., openlink.sql, containing the following line --

SQL
SET SCHEMA 'PUB';


Note: In some environments, varying with the precise version of the Progress and OpenLink components in use, the trailing semicolon may need to be removed, changing the file content to --

SQL
SET SCHEMA 'PUB'

Single-Tier "Lite" Edition Setup

Set the "Initial SQL" field of your DSN to the full path to the file created above, including its file extension (e.g., /opt/openlink/bin/openlink.sql, C:\Program Files\OpenLink Software\UDA\bin\openlink.sql, /Library/Application Support/openlink/bin/openlink.sql).

On Windows, this DSN attribute is found on the fourth pane of the Setup Dialog, under the heading Additional connect parameters.

On a Unix client, the $ODBCINI DSN keyword to hold this value is initsql.

Multi-Tier "Enterprise" Edition Setup

For connections with our Multi-Tier driver, the openlink.sql file must be located on the Broker host, and the Rulebook must be adjusted to specify it through the CommandLine Agent setup parameter, and the +initsql argument, for instance --

INI
Commandline = +initsql /opt/openlink/bin/openlink.sql
Multi-Tier Rulebook Settings: [generic_agentname]

Each Database Agent will have a section that is typically called "generic_" followed by a database label. For example: [generic_virt], [generic_odbc], [generic_db2].

Parameter Default Comment
Program name of the executable to run
Environment specify Environment section to use
CommandLine commandline options (optional)
ServerOptions force DBMS-specific client options (optional)
Directory where to chdir before starting the Agent
Database force name of the database (optional)
ConnectOptions force DBMS-specific connect options (optional)
UserID force userid (optional)
Password force password (optional)
ReadOnly No force read-only mode (optional)
OpsysLogin No when set to Yes, the Request Broker will do an operating system login before spawning. This implies ReUse = ifsame user. (optional)
NeedsCLI (VMS only) Use CLI to spawn the agent
ReUse never Defines how an agent will be re-used. See below for details of the ReUse Parameter.

CommandLine parameter

The CommandLine value can include any or all of the following options:

  • +noautocommit -- This means that all connections routed (by the mapping rules) through this agent section will have autocommit behaviour turned off. This is useful if your client-side application relies on manual commits of its transactions; you can define a mapping rule to match only that application and add +noautocommit, while other applications use a different agent section.
  • +maxrows -- This defines the maximum number of rows to fetch from any query.
  • +initsql -- Specifies a file with a set of SQL statements to execute immediately when each connection is established. For example, this can be useful to set transaction isolation levels, if your application assumes them to be set a specific way.
  • +jetfix -- This enables various workarounds for operation with the Microsoft Jet Engine, e.g., through MS Access or MS Query. Particularly, data type mappings may be changed for greater accuracy using these applications.
  • +norowsetlimit -- This disables any rowset-size limit; it is useful in cursor operations on large tables.

ReUse parameter

always is implied by all values other than never.
When is agent re-used
never never reuse this instance (default)
always always try to reuse this instance
upto <n> allow at most n connection to the same instance
ifreadonly allow only read-only requests
ifsame database group connection requests that alias to the same database
ifsame process group connections with the same calling process id (pid)
ifsame options group connections specifying the same connect options
ifsame application group connections from same application alias
ifsame user group connections from the same username
ifsame machine group connections from the same client host
ifsame opsys group connections from the same operating system
Configure Progress For Unicode Support

Configure Progress For Unicode Support

For ESQL-92 clients the internal codepage is determined by the value of the client's SQL_CLIENT_CHARSET environment variable, if set. Otherwise, the internal codepage is that of the client's locale. There is a similar environment variable that controls the codepage of messages sent by the database server.

See Also: ProgressUnicodeConfig

Setting Transaction Isolation Levels for connections to Progress/ OpenEdge

Enterprise Edition Multi-Tier Drivers

  1. Log in to the Broker host.
  2. Use a text editor to open the active Rulebook (default is /<...OpenLink Installation...>/bin/oplrqb.ini).
  3. Locate the relevant Environment section, e.g., [Environment PROGRESS110SQL], [Environment PROGRESS100SQL], or [Environment PROGRESS91SQL].
  4. Add the following keyword to the existing list of parameters:

    Example
    DEFAULT_TXN_ISOLATION

  5. Set your desired transaction isolation level. The options are:

    Example
    READ_UNCOMMITTED
    READ_COMMITTED
    REPEATABLE_READ
    SERIALIZABLE

    For instance:

    INI
    DEFAULT_TXN_ISOLATION = READ_UNCOMMITTED

  6. Save your changes and exit the file.
  7. Restart or reinitialize your Request Broker service to activate the change.

Lite Edition Single-Tier Drivers

  1. Log in to the machine hosting the driver.
  2. Launch the ODBC Administrator.
  3. Locate & highlight your Data Source Name.
  4. Click Configure.
  5. Locate the Default Transaction Isolation menu.
  6. Select your desired isolation level.
  7. Save the changes to your DSN.
Using Progress 4GL/SQL-89 ARRAY fields with SQL-92 drivers

Using Progress 4GL/SQL-89 ARRAY fields with SQL-92 drivers

Quoted from Progress On-Line documentation

C.2 Support for the ARRAY Data Type

For compatibility with earlier Progress databases, Progress SQL–92 provides limited support for the ARRAY data type.

C.2.1 Overview

Array fields are created using the Progress 4GL Dictionary. Progress SQL–92 provides a mechanism for referencing and updating these arrays. Subscripted references are not supported. Progress SQL–92 manages the arrays as NVARCHAR strings, and the string representation is the concatenation of each array element, with a semicolon ( ; ) separating each element.

To escape an instance of a semicolon in the data of a Progress CHARACTER array, use the escape character tilde before the semicolon ( ~; ). An unquoted question mark represents a NULL element. To distinguish a NULL element from a question mark, use a tilde as an escape character for a question mark in the data ( ~? ). A tilde is also the escape character for a tilde ( ~~ ).

Progress SQL–92 supplies three built–in functions for extracting an element, and for adding escape characters to and removing escape characters from a single element of a character array. The PRO_ELEMENT, PRO_ARR_ESCAPE, and PRO_ARR_DESCAPE functions provide full internationalization support. A description of each function follows.

C.2.2 PRO_ELEMENT Function

Extracts one or more elements from an array column and returns the NVARCHAR or VARCHAR string between the specified positions, including any internal separator characters and any internal escape characters.

SYNTAX

PRO_ELEMENT ( 'array_style_expression', start_position, end_position ) ;

array_style_expression
A string of datatype VARCHAR or CHAR, with a semi-colon ( ; ) separating each element of the array.
start_position
The position in the string marking the beginning of the element PRO_ELEMENT is to extract.
end_position
The position in the string marking the end of the element to be extracted.
EXAMPLES

The following example returns the string 'bb':

PRO_ELEMENT('aa;bb;cc', 2, 2) ;

The next example returns the string 'aa;bb':

PRO_ELEMENT('aa;bb;cc', 1, 2) ;

The third example returns the string 'aa~;aa':

PRO_ELEMENT('aa~;aa;bb;cc', 1, 1) ;

NOTES
  • The array_style_expression must be data type NVARCHAR, VARCHAR, or CHAR.

  • The returned string does not include the leading separator of the first element, or the trailing separator ( ; ) of the last element.

  • Even if you are extracting only one element, the escape characters are included in the result.

  • You must invoke PRO_ARR_DESCAPE to remove any escape characters.

C.2.3 PRO_ARR_ESCAPE Function

Adds required escape characters to a single element of a character array.

PRO_ARR_ESCAPE scans the char_element looking for the separator character ( ; ) or an escape character ( ~ ). The function inserts an additional escape character, when it finds any of these constructs:

  • Escape character followed by a separator character ( ~; )

  • Escape character followed by another escape character ( ~~ )

  • Escape character followed by a NULL terminator ( ~\0 )

SYNTAX

PRO_ARR_ESCAPE( 'char_element' ) ;

char_element
The character representation of an array element, without any leading or trailing separators. Must be data type NVARCHAR or VARCHAR or CHAR.
EXAMPLES

The following example returns the string 'aa~;aa':

PRO_ARR_ESCAPE('aa;aa') ;

The following example returns the string 'aa~aa'. There is no change, since another special character does not follow the escape character:

PRO_ARR_ESCAPE('aa~aa') ;

The third example returns the string 'aa~~;aa':

PRO_ARR_ESCAPE('aa~;aa') ;

NOTES
  • char_element must be data type NVARCHAR, VARCHAR, or CHAR.

  • char_element must not be the name of an array column, since the column contains true separators which would be destroyed by this function.

C.2.4 PRO_ARR_DESCAPE Function

Removes escape characters from a single element of a character array. PRO_ARR_DESCAPE scans the char_element looking for the separator character ( ; ) or an escape character ( ~ ). The function removes an escape character, when it finds any of these constructs:

  • Escape character followed by a separator character ( ~; )

  • Escape character followed by another escape character ( ~~ )

  • Escape character followed by a NULL terminator ( ~\0 )

    SYNTAX

    PRO_ARR_DESCAPE( 'char_element' ) ;

char_element
The character representation of an array element, without any leading or trailing separators. Must be data type NVARCHAR or VARCHAR or CHAR.
EXAMPLES

The following example returns the string 'aa;aa':

PRO_ARR_DESCAPE('aa~;aa') ;

The following example returns the string 'aa~aa'. There is no change, since another special character does not follow the escape character:

PRO_ARR_DESCAPE('aa~aa') ;

The third example returns the string 'aa~;aa':

PRO_ARR_DESCAPE('aa~~;aa') ;

NOTE: char_element should not be the name of an array column, since the column contains true separators which would be destroyed by this function.

C.2.5 Unsubscripted Array References

When there is a reference to an unsubscripted Progress array column, Progress SQL–92 performs these operations:

  • Extracts each element from the Progress 4GL array

  • Converts the element to a DT_VARCHAR data type

  • Passes the element to the PRO_ARR_ESCAPE function for the addition of any necessary escape characters

  • Concatenates the result to a composite with the separator character ( ; ) between this element and the next element

This results in dual data types for array fields. The fetch type is TPE_DT_NVARCHAR for the unsubscripted references. The underlying Progress 4GL data type is the native type.

EXAMPLES
The first example assumes a character array named ARRAYCHAR containing three elements in a row in the customer table where the cust_num column is equal to 88, and with values:

ARRAYCHAR[ 1 ] = 'aa'

ARRAYCHAR[ 2 ] = 'bb'

ARRAYCHAR[ 3 ] = 'cc'

The ARRAYCHAR example returns the value 'aa;bb;cc'.

SELECT arraychar FROM customer WHERE cust_num = 88 ;

ARRAYCHAR

–––––––––

aa;bb;cc

1 record selected

To retrieve an individual element from an array with any escape characters removed, use the PRO_ELEMENT and PRO_ARR_DESCAPE functions. For example, ARRAYTYPE[ 2 ] contains the value 'aa;bb'. The PRO_ELEMENT function in the ARRAYTYPE example returns 'aa~;bb' and PRO_ARR_DESCAPE('aa~;bb') removes the escape character ( ~ ), returning the element value 'aa;bb'.

select pro_arr_descape(pro_element(arraytype,2,2)) from customer ;

ARRAYTYPE

–––––––––

aa;bb

1 record selected

C.2.6 Unsubscripted Array Updates and Inserts

Progress SQL–92 applies the reverse of the fetch algorithm for updates to unsubscripted Progress 4GL array columns. An SQL-92 operation accepts an NVARCHAR string, complete with separators and any required escape characters. Progress SQL–92 converts the string to the underlying data type and stores it in the current element of the array in the Progress database. SQL-92 repeats this operation for each element of the array until all elements have been inserted.

This is the SQL-92 syntax for an unsubscripted array update:

SYNTAX

UPDATE table_name SET array_name = ('char_element' ) WHERE where_criteria ;

EXAMPLE
The ARRAYINT example assumes an integer array named ARRAYINT. The result of the UPDATE operation is:

ARRAYINT[ 1 ] = 13

ARRAYINT[ 2 ] = 15

ARRAYINT[ 3 ] = 19

UPDATE customer SET arrayint = '13;15;19' WHERE cust_num = 77 ;

If the number of elements in the NVARCHAR string does not match the number of elements in the target column for the update, Progress SQL–92 returns an error, unless there is exactly one element in the NVARCHAR string for an INSERT operation.

If there is a single element in the NVARCHAR string, you can use the Progress SQL–92 INSERT statement to propagate the value to all elements of the array.

This is the SQL-92 syntax for this short form of an INSERT assignment:

SYNTAX

INSERT INTO table_name ( arr_col_name ) VALUES ( 'one_value' ) ;

EXAMPLE

The following INSERT example illustrates how you can assign values to an entire date array from a single value in the VALUES clause of an SQL-92 INSERT statement:

INSERT INTO customer ( begin_quota_date ) VALUES ( '01/01/00' ) ;

This INSERT example assigns the value '01/01/00' to every element of the date array 'begin_quota_date' column in the customer table.

NOTE: Progress SQL–92 does not support the assignment of a single value to an entire array using an SQL-92 UPDATE statement.

Updating a Single Element of an Array

To update a single element of an array, you must construct a string for the entire array, and assign the string to the array using an SQL-92 UPDATE statement.

This is the SQL-92 syntax for updating a single element of an array:

SYNTAX

UPDATE table_name SET array_col = literal_string ;

EXAMPLES

To assign a value to the first element of an array of size three, construct a literal string that concatenates these components:

  • Update value for the first element in the array

  • Semicolon separator

  • Values for elements two and three in the array

Use PRO_ARR_ESCAPE to insert any necessary escape characters into the new value. Use PRO_ELEMENT to extract the values for elements two and three from the array. This example assigns the value 'aaa' to the first element of the arraychar array for customer 99, and retains the existing values for elements two and three.

UPDATE customer SET arraychar =

     PROARR_ESCAPE('aaa')

     || ';'

     || PRO_ELEMENT(arraychar,2,3)

WHERE cust_num = 99 ;

To assign a value to the second element of an array of size three, construct a string that concatenates these components:

  • Value of the first element in the array

  • Semicolon separator

  • Update value for the second element

  • Semicolon separator

  • Value of the third element in the array

Use PRO_ARR_ESCAPE to insert any necessary escape characters into the new value. Use PRO_ELEMENT to extract the first and third elements from the array. This example assigns the value 'bbb' to the second element of the arraychar array for customer 99, and retains the existing values for elements one and three in arraychar.

UPDATE customer SET arraychar =

     PRO_ELEMENT(arraychar,1,1)

     || ';'

     || PROARR_ESCAPE('bbb')

     || ';'

     || PRO_ELEMENT(arraychar,3,3)

WHERE cust_num = 99 ;

← Data access drivers