Sybase Concepts Overview

A quick overview of some basic design concepts underlying the Sybase Database Management System will help you interface your COBOL program to it.

Servers

A Sybase server is one copy of the database engine executing on a computer. A server has a name, and when a program wants to access the database controlled by a server, the program asks for a connection to that server by name. Multiple servers can be executing on a single machine, controlling different databases. The default name that Sybase gives to a server is SYBASE. Naming of servers is discussed in A_SYB_DEFAULT_CONNECTION.

Table ownership

Table names in Sybase have the form database.owner.table_name. Within Sybase, if you are the owner of a given table, you can refer to it as just table_name. If you are not the owner, you must refer to it with the owner of the table as a prefix. Different owners can thus have tables of the same name. However, this is not true when you use Acu4GL for Sybase.

Acu4GL for Sybase works a little differently. It automatically determines the owner name it will use to reference a table. It is therefore essential that there not be multiple tables with the same name in a single database, even though the tables have different owners. If there are, the Acu4GL for Sybase product will not necessarily find the correct one, and no diagnostic will be issued.

Note that table names include dots (“.”) as separators. Because of this, you must make sure there are no extensions on COBOL file names that will be converted to table names. If you were to have a COBOL file named “IDX1.DAT”, Acu4GL for Sybase would attempt to open a table DAT with owner IDX1. You can avoid this problem either by renaming your COBOL file in your source program, or by using an ACUCOBOL-GT® runtime configuration file entry to map the file name to an allowable file name, such as:

IDX1.DAT  IDX1

If you map your file name to a new name, we recommend that you simply drop the extension to form the new name. Here’s why. The compiler uses the base file name — without the extension — to create the XFD file name (“IDX1.XFD”). The runtime needs to be able to locate this file. But if you’ve mapped the file name to something completely different (such as “MYFILE”), the runtime will look for an XFD file named “MYFILE.XFD”. So you’d have to remember to change the name of “IDX1.XFD” to “MYFILE.XFD” in the XFD directory. Save yourself this extra step by simply dropping the extension when you map the name.

Security

Security is implemented in the Sybase RDBMS. A user is required to log in to the RDBMS before any file processing can occur. Acu4GL for Sybase provides both a default and a user-configurable method for implementing this.

Generally, it is best for someone with Database Administrator (DBA) privileges to create and drop the tables, allowing others only the permissions to add, change, or delete information contained in them.

See the Sybase documentation for more details on DBA privileges.

Alternate REWRITE method

If the above stored procedure is not available, then the update query passed to the database has been optimized to update only dirty columns. This should improve performance.