Compile Insert Transact_Constants
*
* CONSTANTS FILE FOR THE SQL TRANSACTION CONTROL PROCEDURES
*
* 03-20-2015   rjc   Copied In From Rev_BP

* TRANSACT function - miscellaneous equates
*
EQU OFF$   TO 0
EQU ON$    TO 1

* Names of the SQL transaction files
*
EQU COMMIT_FILE_NAME$ TO "REVCOMMITLOG"  ;* Prefix for the Commit Log  (CL)
EQU TRANS_FILE_NAME$  TO "REVTF_"      ;* Prefix of the transaction files  (TF)
EQU TRANS_LOG_NAME$   TO "REVTL_"      ;* Prefix of transaction log  (TL)

* Smart filing system equates for transactions
*
EQU SMART_FS_INDEX$   TO 0        ;* Smart filing system no trans file needed
*
* Record prefix in the commit log
*
EQU MACHINE_NAME_ENTRY$ TO "%ID%" ;* Prefix of record name for machine entry in commit log

* Transaction File Codes - 1st character of the record
*
EQU DELETE_CODE$     TO 'D'  ;* Signifies DELETE in transaction file
EQU CLEAR_CODE$      TO 'C'  ;*     ''    CLEARFILE    ''        ''
EQU WRITE_CODE$      TO 'W'  ;* This code is either an UPDATE or INSERT
EQU DELETE_RECORD$   TO '%%DELETEMASK%%'  ;* This record contains values
                                           * which are used in SQL_DISTINCT.

* Field numbers for the TRANS.INFO@ variable and DEADLOCK log record
*
EQU TRANS.INFO.TIME$  TO 1   ;* Start time of transaction
EQU TRANS.INFO.DATE$  TO 2   ;* Start date of transaction.
EQU TRANS.INFO.ACTIVITY$ TO 3  ;* Read/Write activity field.
EQU TRANS.INFO.MASK$  TO 4   ;* Contains the file name whose delete mask is in use
EQU STATION.NAMES$    TO 4   ;* Stations which are in contention
EQU READ.VALUE$       TO 1   ;* Activity value of Read Statement
EQU WRITE.VALUE$      TO 3   ;* Activity value of Write/Delete Statement
EQU CLEAR.VALUE$      TO 5   ;* Activity value of Clearfile Statement

* Constants which pertain to locking and deadlock detection
*
EQU SHARED_LOCK_MARK$ TO 2   ;* This mark indicates a shared lock record in the lock file
EQU EXCL_LOCK_MARK$   TO 1     ;* This mark indicates an exclusive lock record in the lock file
EQU FILE_LOCK_MARK$   TO 1     ;* This mark indicates a file lock
EQU REC_LOCK_MARK$    TO 2      ;* This mark indicates a record lock
EQU TRANS_LOCK_NAME$  TO "SQL_LF."  ;* Prefix for a lock file (LF)
EQU DEADLOCK_FILE_NAME$ TO "SQL_DF"  ;* Name of centralized deadlock file (DL)
EQU VICTIM_YOUNGEST$  TO 0    ;* Selects the youngest as a victim
EQU VICTIM_ACTIVITY$  TO 1    ;* Selects the transaction with lowest activity
EQU UPDATE_RECORD$    TO "%%SQL_UPGRADE_LOCK%%"  ;* Record name when upgrading
                                                  * shared lock to table lock.
EQU SEMA_LOCK_NAME$   TO "SEMAPHORE"  ;* Pseudo-file handle for a semaphore lock


* TRANSACT function - parameter values for the ACTION parameter
*
EQU ROLLBACK$          TO 0
EQU COMMIT$            TO 1
EQU BEGIN_TRANSACTION$ TO 2
EQU RESTART$           TO 3
EQU RESTART_SUPPRESS$  TO 4   ;* This will suppress all STATUP on-screen messages
EQU ROLLBACK_SUPPRESS$ TO 5   ;* This will suppress all STATUP on-screen messages
EQU COMMIT_SUPPRESS$   TO 6   ;*  ''   ''     ''      ''
EQU SET_TRANS$         TO 7   ;* Parameters passed in SQLSTATE

* Locking functions - parameter values for the OPERATION parameter
*
EQU OP_MODIFY$   TO 0        ;* This statement is changing data
EQU OP_SELECT$   TO 1        ;* This statement is only querying data

* Equates for the different consistency levels
*
EQU CL_4$ TO 4     ;* 4 defined under the SQL2 standards
EQU CL_3$ TO 3     ;* 3 releases shared locks early (at post-query/op time)
EQU CL_2$ TO 2     ;* 2 defined under the SQL2 standards
EQU CL_1$ TO 1     ;* 1 like 0, but locking for update is performed (the
                    * lock is released at post-query/op time).
EQU CL_0$ TO 0     ;* 0 defined under SQL2 standards except ROLLBACK and
                    * COMMIT operations are not functional and NO locking is
                    * performed.

* FILE.NAMES@ variable
EQU FILE_NAME$       TO 1  ;* List of filenames is first field
EQU CLEAR_FILE$      TO 2  ;* List of associated clear file marks is the second
EQU DELETE_FLAG$     TO 3  ;* A flag which marks a file has had deletions.
EQU VOLUME_NAME$     TO 4  ;* Volume where the file exists - used for Restart
EQU SMART_VOLUMES$   TO 5  ;* Ordered list of smart AFS's which contain their
                            * own transaction control. Ordering based on
                            * intelligence - Most intelligent are first.

* LOCK_INFO@ variable
*
EQU TOTAL$           TO 1  ;* Total lock counts for file/record & impl/expl locks
EQU FILE_NAMES$      TO 2  ;* Lock file names
EQU FILE_LOCKS$      TO 3  ;* List of codes for shared or file locks
EQU FILE_LOCK_TYPES$ TO 4  ;* Mode of the lock
EQU REC_KEYS$        TO 5  ;* List of keys for record locks
EQU REC_LOCKS$       TO 6  ;* Type of record lock used
EQU REC_LOCK_TYPES$  TO 7  ;* Mode of this record lock

* LOCK_INFO@ variable - lock types for FILE_LOCK_TYPES$ and REC_LOCK_TYPES$
*
EQU LOCK_TYPE_EXPL$ TO 0 ;* Explicit lock type
EQU LOCK_TYPE_BUMP$ TO 1 ;* Explicit lock type which has been bumped - the
                          * unlock will be delayed until commit time.
EQU LOCK_TYPE_IMPL$ TO 2 ;* Implicit lock type

* Possible values for the TRANS.CONTROL@ variable
*
EQU TRANS_OFF$       TO 0  ;* Transaction is turned off
EQU TRANS_ON$        TO 1  ;* Transaction is turned on
EQU TRANS_ACTIVE$    TO 2  ;* Transaction is active

* Equates for the INSERT_LIST_DATA@ variable
*
EQU SELECT_RN_DATA$  TO 1  ;* This is the first field of this variable
EQU KEY_LIST_DATA$   TO 2  ;* This is the second field of this variable

* Subfields of the SELECT_RN_DATA$ field of the INSERT_LIST_DATA@ var
*
EQU TOTAL_LISTS$     TO 1  ;* Total number of lists (on disk & in memory)
EQU LISTS_PROCESSED$ TO 2  ;* Total number of lists processed by READNEXT

EQU MAX_INSERT_LIST_LEN$  TO 55000 ;* Maximum size of total list
EQU MAX_FILE_LIST_LEN$ TO 6     ;* Max size of a list per file
* Source Date: 16:42:32  12 JAN 1993  Build ID: OI*1.0.10  Level: 2.0
