HP 3000 Manuals

Descriptions of Directives (cont) [ Micro Focus COBOL System Reference, Volume 2 ] MPE/iX 5.0 Documentation


Micro Focus COBOL System Reference, Volume 2

Descriptions of Directives (cont) 

SQL  

Allows EXEC SQL statements in your program, and specifies the database
engine that is being used at both compilation and run time.

Syntax:.   

[]
Parameters:. dbman Specifies which database manager/ requester to use. Default:. NOSQL Phase:. Syntax check Environment:. DOS, Windows and OS/2 $SET:. Initial Dependencies:. If it is the first SQLxx directive encountered, then SQL sets SQLINIT"S" SQLPRE"ALL" Remarks:. The possible values of dbman are: dbman Compile time Run time ----------------------------------------------- IBM see below see below IBMDBM OS/2 EE DBM OS/2 EE DBM IBMDBR OS/2 EE DBM OS/2 EE DBR IBMES1DBM ES/2 1.0 DBM ES/2 1.0 DBM IBMES1DBR ES/2 1.0 DBM ES/2 1.0 DBR MSSQL MS SQL Server MS SQL Server MSDR MS SQL Server MS SQL Server OS2 see below see below OS2DBM OS/2 EE DBM OS/2 EE DBM OS2DBR OS/2 EE DBM OS/2 EE DBR OS2ES1DBM ES/2 1.0 DBM ES/2 1.0 DBM OS2ES1DBR ES/2 1.0 DBM ES/2 1.0 DBR OS2DB21 DB/2 1.0 DB/2 1.0 where: OS/2 EE DBM = IBM OS/2 Extended Edition Database Manager OS/2 EE DBR = IBM OS/2 Extended Edition DOS Database Requester ES/2 1.0 DBM = IBM Extended Services/2 V1.0 Database Manager ES/2 1.0 DBR = IBM Extended Services/2 V1.0 Database Requester DB/2 1.0 = IBM DB2/2 V1.0 MS SQL Server = Microsoft SQL Server V4.2 or later with Microsoft embedded SQL for COBOL developers kit V4.21 or later. If IBM or OS2 is specified, the version of DBM/DBR being used is determined at compilation time and run time. If no parameter is supplied, IBM is assumed. The default values of the group of SQL directives are dependent upon the value of the SQL directive as follows: SQL"dbman" The default values of related SQL directives are those documented here. NOSQL Where a NO option exists for related SQL directives they default to their NO value. SQL directives without a NO option are ignored.
WARNING The SQL directive is set implicitly when any other SQL directive is either set to a specific value or to NO. For example, although the default value of SQL is NOSQL, specifying NOSQLINIT implicitly sets SQL. You must set NOSQL explicitly if you want to ensure that all other SQL directives are ignored.
SQLACCESS Specifies the name of the access plan to be created by precompiler services and stored in the database. Syntax:.
[]
Parameters:. access-plan The root of a file-name, or a null string. Default:. SQLACCESS " " Phase:. Syntax check Environment:. DOS, Windows and OS/2 $SET:. Initial Dependencies:. If it is the first SQLxx directive encountered, then SQLACCESS sets SQL"IBM" SQLINIT"S" SQLPRE"ALL" Remarks:. The name of the access plan must not have an extension. If you specify SQLACCESS" ", the access plan is given the same name as the compiled program, without path or extension. If no access plan is to be created, use NOSQLACCESS. SQLBIND Specifies the name of the bind file to be created by precompiler services. Syntax:.
[]
Parameters:. bindfile-name A full file specification or a null string. Default:. SQLBIND " " Phase:. Syntax check Environment:. DOS, Windows and OS/2 $SET:. Initial Dependencies:. If it is the first SQLxx directive encountered, then SQLBIND sets SQL"IBM" SQLINIT"S" SQLPRE"ALL" Remarks:. If you specify SQLBIND " ", the bind file is given the same name as the compiled program, except that the file extension becomes .BND. If no bind file is to be created, use NOSQLBIND. SQLBLOCK Specifies the record blocking mode to be used on plan creation. Syntax:.
[]
Parameters:. block-mode The blocking mode to be used. Default:. SQLBLOCK"UNAMBIG" Phase:. Syntax check Environment:. DOS, Windows and OS/2 $SET:. Initial Dependencies:. If it is the first SQLxx directive encountered, then SQLBLOCK sets SQL"IBM" SQLINIT"S" SQLPRE"ALL" Remarks:. The possible values of block-mode are: ALL Blocking occurs for fetch-only cursors. Ambiguous cursors are treated as fetch-only. UNAMBIG Blocking occurs for fetch-only cursors. Ambiguous cursors are treated as updatable. NO Blocking does not occur. This directive only affects IBM Database Manager and DB2/2. SQLCTRACE Causes listing output to contain diagnostics showing calls to precompiler services.
[]
Parameters:. None Default:. NOSQLCTRACE Phase:. Syntax check Environment:. DOS, Windows and OS/2 $SET:. Any Dependencies:. If it is the first SQLxx directive encountered, then SQLCTRACE sets SQL"IBM" SQLINIT"S" SQLPRE"ALL" SQLDB Specifies the name of the database that the program accesses. Syntax:.
[]
Parameters:. database-name An alphanumeric string obeying the rules for a Database Manager database name. Default:. NOSQLDB Phase:. Syntax check Environment:. DOS, Windows and OS/2 $SET:. Initial Dependencies:. If it is the first SQLxx directive encountered, then SQLDB sets SQL"IBM" SQLINIT"S" SQLPRE"ALL" Remarks:. If NOSQLDB and NOSQLACCESS are used, then the application should be bound to a particular database before execution. In this case, you should make the Compiler create a bind-file by using the SQLBIND directive. The bind-file can then be used either to bind the program to the database using the SQLBIND command for IBM Database Manager, or as a SQL script to create a Microsoft SQL Server stored procedure. You must specify SQLDB when using the OS/2 Extended Edition database manager and DB2/2. SQLDB2 Specifies that data items defined outside the scope of a BEGIN DECLARE SECTION are allowed as host variables. This is for compatibility with IBM Mainframes. Syntax:.
[]
Parameters:. None Default:. NOSQLDB2 Phase:. Syntax check Environment:. DOS, Windows and OS/2 $SET:. Initial Dependencies:. If it is the first SQLxx directive encountered, then SQLDB2 sets SQL"IBM" SQLINIT"S" SQLPRE"ALL" Remarks:. With NOSQLDB2, any data item that is defined outside a BEGIN DECLARE SECTION and is used in an SQL statement is assumed to be an SQLDA. This is as in Database Manager and DB2/2 on OS/2. With SQLDB2 set, data items are inspected to see if they are host variables or an SQLDA. This provides compatibility with DB2 on IBM mainframes. SQLECSPP This directive is reserved for use with the add-on product "Micro Focus HOST Compatibility Option for IBM Database Manager". Do not change its setting unless using this add-on product. Syntax:.
[]
Parameters:. parameter This parameter has no effect on the behavior of this directive. It is included for compatibility purposes. Default:. NOSQLECSPP Phase:. Syntax check Environment:. DOS, Windows and OS/2 $SET:. Initial Dependencies:. If it is the first SQLxx directive encountered, then SQLECSPP sets SQL"IBM" SQLINIT"S" SQLPRE"ALL" SQLFORMAT Determines the date and time format when date/time fields are assigned to string representations in host variables. Syntax:.
[]
Parameters:. date-format Identifies the format to use. Default:. SQLFORMAT"LOC" Phase:. Syntax check Environment:. DOS, Windows and OS/2 $SET:. Initial Dependencies:. If it is the first SQLxx directive encountered, then SQLFORMAT sets SQL"IBM" SQLINIT"S" SQLPRE"ALL" Remarks:. The possible values of date-format are: DEF determined by country code USA mm/dd/yyyy hh:mm xM (AM/PM) EUR dd.mm.yyyy hh.mm.ss ISO yyyy-mm-dd hh.mm.ss JIS yyyy-mm-dd hh:mm:ss LOC Local form When DEF or LOC is specified, these are the formats used: Country LOC date LOC time DEF date DEF time ----------------------------------------------------------------------------------------- 001 USA mm-dd-yyyy hh:mm:ss mm/dd/yyyy hh:mm xM (AM/PM) 002 Canada/Fr dd-mm-yyyy hh.mm.ss yyyy-mm-dd hh.mm.ss 044 UK dd/mm/yyyy hh:mm:ss dd/mm/yyyy hh:mm:ss 033 France dd/mm/yyyy hh:mm:ss dd.mm.yyyy hh.mm.ss 049 Germany dd/mm/yyyy hh.mm.ss yyyy-mm-dd hh.mm.ss 034 Spain dd/mm/yyyy hh:mm:ss dd/mm/yyyy hh:mm:ss 039 Italy dd/mm/yyyy hh:mm:ss dd/mm/yyyy hh:mm:ss 046 Sweden dd/mm/yyyy hh.mm.ss yyyy-mm-dd hh.mm.ss 045 Denmark dd-mm-yyyy hh.mm.ss yyyy-mm-dd hh.mm.ss 047 Norway dd/mm/yyyy hh.mm.ss dd.mm.yyyy hh.mm.ss 031 Netherlands dd-mm-yyyy hh:mm:ss yyyy-mm-dd hh.mm.ss 032 Belgium dd/mm/yyyy hh:mm:ss dd/mm/yyyy hh:mm:ss See the IBM OS/2 Database Manager SQL Reference for more details. This directive affects only IBM Database Manager and DB2/2. SQLINIT Makes the program initialize SQL and log on to the database. Syntax:.
[]
Parameters:. mode Specifies whether the database is to be used in shared or exclusive mode. Default:. SQLINIT"S" Phase:. Syntax check Environment:. DOS, Windows and OS/2 $SET:. Initial Dependencies:. If it is the first SQLxx directive encountered, then SQLINIT sets SQL"IBM" SQLPRE"ALL" Remarks:. The possible values of mode are: S database to be used in shared mode X database to be used in exclusive mode SQLINIT also causes the program to register a process so that the database is always properly closed down when a STOP RUN occurs. Without this you can leave the database in a corrupt condition when the program terminates prior to completion; for example, if you terminate an animation session before completing the program. This protection can be applied without initializing by using the SQLPROT directive. NOSQLINIT should be specified for SQL programs that are called by other SQL programs. It can also be specified for the first SQL program in a run-unit, but the program must contain one of the following before executing any other EXEC SQL statement: * call sqlgstrd (IBM Database Manager), * call sqlwstrd (Microsoft SQL Server) * a CONNECT statement (IBM DB2/2) SQLISOLATION Specifies the isolation level to use. Syntax:.
[]
Parameters:. isol-level The isolation level to use. Default:. SQLISOLATION"CS" Phase:. Syntax check Environment:. DOS, Windows and OS/2 $SET:. Initial Dependencies:. If it is the first SQLxx directive encountered, then SQLISOLATION sets SQL"IBM" SQLINIT"S" SQLPRE"ALL" Remarks:. The possible values of isol-level are: RR Repeatable read CS Cursor stability UR Uncommitted read This directive affects only IBM Database Manager and DB2/2. SQLNOT Specifies the value to use for the NOT character (). Syntax:.
[]
Parameters:. integer The ASCII value, in decimal, of the character to use. Default:. SQLNOT"170" Phase:. Syntax check Environment:. DOS, Windows and OS/2 $SET:. Initial Dependencies:. If it is the first SQLxx directive encountered, then SQLNOT sets SQL"IBM" SQLINIT"S" SQLPRE"ALL" Remarks:. You can specify any value from 0 through 255 for integer. This directive is provided for use on systems that do not use 170 to represent the not () character. SQLPASS Specifies the password of the database. Syntax:.
[]
Parameters:. password An alphanumeric string obeying the rules for a database password Default:. NOSQLPASS Phase:. Syntax check Environment:. DOS, Windows and OS/2 $SET:. Initial Dependencies:. If it is the first SQLxx directive encountered, then SQLPASS sets SQL"IBM" SQLINIT"S" SQLPRE"ALL" Remarks:. If the database has no password, use NOSQLPASS. This directive should only be specified if you are using Microsoft SQL Server. SQLPRE Allows SQL programs to be animated or run by preloading the database API modules. Syntax:.
[]
Parameters:. set-level specifies which set of modules to preload Default:. SQLPRE"ALL" Phase:. Syntax check Environment:. DOS, Windows and OS/2 $SET:. Initial Dependencies:. If it is the first SQLxx directive encountered, then SQLPRE sets SQL"IBM" SQLINIT"S" Remarks:. The possible values of set-level are: ALL all modules REQ only those modules that are used by EXEC SQL statements Specifying this directive causes a call to be generated to a module which preloads the API modules required when running an SQL program. This ensures that any SQL calls generated by embedded SQL commands or coded in the program can be resolved when running or animating. If no user coded calls to SQL are made, then SQLPRE"REQ" can be used, which causes the startup code to be executed more quickly. Applications that are to be linked to create a .dll or .exe file do not need this directive to be specified. However, doing so has no effect. SQLPROT Makes the program call SQLPROT to provide protection for the database on STOP RUN. Syntax:.
[]
Parameters:. None Default:. NOSQLPROT Phase:. Syntax check Environment:. DOS, Windows and OS/2 $SET:. Initial Dependencies:. If it is the first SQLxx directive encountered, then SQLPROT sets SQL"IBM" SQLINIT"S" SQLPRE"ALL" Remarks:. Using SQLPROT results in the program registering a process so that the database is always closed down properly when a STOP RUN is encountered. This is the same as provided by SQLINIT, so SQLPROT is only needed when NOSQLINIT is specified. Hence, NOSQLINIT SQLPROT should be specified for SQL programs that need to protect the database on STOP RUN but do not want to initialize. SQLRP Enables an SQL program to be compiled on a client machine using the database engine on a server. Syntax:.
[]
Parameters:. server-id Name of server containing the database engine, as specified in the file sqlrp.cfg. Default:. NOSQLRP Phase:. Syntax check Environment:. DOS, Windows and OS/2 $SET:. Initial Dependencies:. If it is the first SQLxx directive encountered, then SQLRP sets SQL"IBM" SQLINIT"S" SQLPRE"ALL" Remarks:. See your COBOL User Guide for more details of this operation, and the sqlrp.cfg file. SQLSTDLVL Specifies the standards level of the database manager. Syntax:.
[]
Parameters:. standard-level The standard level to be used. Default:. SQLSTDLVL"NONE" Phase:. Syntax check Environment:. DOS, Windows and OS/2 $SET:. Initial Dependencies:. If it is the first SQLxx directive encountered, then SQLSTDLVL sets SQL"IBM" SQLINIT"S" SQLPRE"ALL" Remarks:. This directive affects only IBM ES/2 Database Manager and DB2/2. Possible values for standard-level are: NONE FOR UPDATE clause is required on cursor declarations if tables are updated through the cursor MIA FOR UPDATE clause is optional. Using this option might degrade performance. STDERR Causes error messages to be echoed to STDERR rather than to the console (STDOUT). Syntax:.
[]
Parameters:. None Default:. NOSTDERR Phase:. Syntax check Environment:. UNIX $SET:. Any


MPE/iX 5.0 Documentation