Prepare the runtime environment - connecting to the database

  1. In order to connect to Sybase ASE, you must have a Sybase ASE database driver "dbmase*" in FGLDIR/dbdrivers.
  2. If you want to connect to a remote database server, you must have the Sybase ASE Client Software installed on the computer running 4gl applications. The Sybase Open Client Library is required.
  3. Make sure that the Sybase ASE client environment variables are properly set. Check for example SYBASE (the path to the installation directory), SYBASE_ASE (the name of the server sub-directory), SYBASE_OCS (the name of the client sub-directory), etc. See Sybase ASE documentation for more details.
  4. Verify the environment variable defining the search path for database client shared libraries (libsybct[64]. so and libsybcs[64].so on UNIX™, LIBSYBCT.DLL and LIBSYBCS.DLL on Windows™). On UNIX platforms, the variable is specific to the operating system. For example, on Solaris and Linux™ systems, it is LD_LIBRARY_PATH, on AIX® it is LIBPATH, or HP/UX it is SHLIB_PATH . On Windows, you define the DLL search path in the PATH environment variable.
    Table 1. Shared library environment setting for Sybase ASE
    Sybase ASE version Shared library environment setting
    Sybase ASE 15.5 and higher

    UNIX: Add $SYBASE/ OCSDIR /lib to LD_LIBRARY_PATH (or its equivalent).

    Windows: Add %SYBASE%\ OCSDIR \dll to PATH. Where OCSDIR is the directory of the Sybase Open Client Software.For example, with Sybase 15.5, this directory is named OCS-15_0.

  5. The name of the Sybase server must be registered in a configuration file. On UNIX, the server name must be defined in the interfaces file located in $SYBASE. On Windows, the server name must be defined in the sql.ini file located in %SYBASE%\ini. You may want to define the DSQUERY environment variable to the name of the server. See Sybase documentation for more details.

    When connecting from a Genero program, both database and server names can be specified with:

    database@server

    For more details see the description for the connection data source parameter in DATABASE and CONNECT instructions.

  6. Check the database client locale settings of Sybase.

    The Sybase client locale must match the locale used by the runtime system (LC_ALL,LANG on UNIX, ANSI code page on Windows).

    By default, Sybase OCS uses the character set defined by the operating system. On Windows, this is the ANSI code page, on UNIX it is defined by LC_CTYPE, LC_ALL or LANG environment variables. Note that Genero BDL allows to define the LANG environment variable also on Windows. The value of the LANG environment variable must be listed in the locales.dat file under the $SYBASE/locales directory, otherwise you will get an error when connecting to the database.

    See also Sybase OCS documentation regarding localization and character set definition.

  7. Test the Sybase ASE Client Software: Make sure the server is started and try to connect to a database by using the Sybase ASE command interpreter:

    $ isql -S server -U appadmin -P password

  8. Set up the fglprofile entries for database connections: Make sure that you are using the ODI driver corresponding to the database client and server version.Because Informix® features emulation are dependant from the database server version, it is mandatory to use the same version of the database client and ODI driver as the server version.
    1. Define the connection timeout with the following fglprofile entry:

      dbi.database.dbname.ase.logintime = integer

      This entry defines the number of seconds to wait for a connection.

      Default is 5 seconds.

    2. Define the number of rows to be pre-fetched for result sets:

      dbi.database.dbname.ase.prefetch.rows = integer

      Default is 10 rows.