**************************************************************** * * COMMENT SECTION * * DATE 1988/12/07 EMBEDDED COBOL LANGUAGE * NIST SQL VALIDATION TEST SUITE V6.0 * DISCLAIMER: * This program was written by employees of NIST to test SQL * implementations for conformance to the SQL standards. * NIST assumes no responsibility for any party's use of * this program. * * MPA002.PCO * WRITTEN BY: J Sullivan * * THIS PROGRAM IS PART A OF A TWO-PART PROGRAM(A & B) THAT * TESTS THE CONCURRENCY OF SQL * * REFERENCES * AMERICAN NATIONAL STANDARD database language - SQL * X3.135-1989 * * SECTION 4.16 Transactions * Paragraph Two ****************************************************************
E 1988/12/07 EMBEDDED COBOLLANGUAGE * DISCLAIMER: 01 dol500 * This program was written by employees of NIST to * implementations for conformance to the SQL standards. 01 dollar PIC S9(9) DISPLAYSIGNLEADINGSEPARATE* MPA002.PCO 01 keyval PIC S9(9) DISPLAYSIGNLEADING * TESTS THE CONCURRENCY OF SQL 01 i PIC S9(9) DISPLAYSIGNLEADINGSEPARATE. 01 uid PIC X(18). 01 uidx PIC X(18). EXECSQLEND DECLARE SECTIONEND-EXEC 01SQLCODEPIC S9(9) COMP. 01 errcnt PIC S9(9) DISPLAYSIGNLEADING* Paragraph Two
*date_time declaration 01 dol1 PIC S9(DISPLAYSIGNLEADINGSEPARATE. 01 THE-TIME 9(java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
EXECSQLCOMMIT MOVESQLCODEDISPLAYjava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
******************** BEGIN TEST0231 *******************
DISPLAY" ACCEPT THE-TIME FROMjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36 DISPLAY"Reference X3.1351989Section 4.16 Transactions
- " " DISPLAY" Paragraph Two - Serializability
- " " DISPLAY"SELECT host variable java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58 withrecomputedhost DISPLAY" e.g. SELECT
java.lang.StringIndexOutOfBoundsException: Range [34, 20) out of bounds for length 62 DISPLAY" UPDATE ... SET DOLLARS = :dol1 ..." DISPLAY"ODE TO SQL-COD
java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 0
- " " DISPLAY" *** program (A DISPLAY"Reference X3.351989Section .16 Transactions
ncy " DISPLAY" *** of SQL. Program A inserts 1000 rows into "
java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
- " "
DISPLAY" This is Program A which starts first and
- " waits.... "
* -----Initialization-----
.
P100. MOVE0 =500=999
java.lang.StringIndexOutOfBoundsException: Range [46, 45) out of bounds for length 54 MOVE if (SQLCODE < 0) then MOVE1" should $ initially" END-IF 1TO
.
P101. EXECSQLINSERT if(SQLCODENOT = 0)then
VALUES (:keyval, MOVE1TO code1 MOVESQLCODETO SQL-COD if (SQLCODENOT = 0) (code1 = 1)then MOVE1TO code1 END-IF COMPUTE keyval =keyval +1 ifEND-IF
END-IF
java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 0
MOVE0TO dollar *pause a little FROM MP2_NEXTKEY WHERE KEYNUMMOVETOi
. TO DISPLAY"MPA002: SQLCODETO
- " $", dollar " should $1500 "
WORK MOVESQLCODETO SQL-COD *end of pause
n sync? END-IF ifc ) DISPLAY" Cannot initialize java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 27 GO SQLCODE END-IF DISPLAY"MPA002: account 1
-"$"
* -----Synchronization-----
.
P102.
*pause a little EXECSQL java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 MOVESQLCODETO0concur MOVE1TO i
.
P103. EXEC . MOVESQLCODETO SQL-COD COMPUTE i = i + 1 if (i < pauze) then GOTO P103 END-IF *end of pause
*are we in sync? MOVE0TO dollar EXECSQLSELECT DOLLARS INTO :dollar FROMMP2_NEXTKEY WHERE KEYNUM = 999END-EXEC MOVESQLCODETO SQL-COD
EXECSQL*start record lock SQLCODETO SQL-COD
if MP2_NEXTKEY WHEREKEYNUM=500END-EXEC DISPLAY" if (SQLCODE NOT = then GOTO P102 END-IF
*YES, we are in sync! MOVE0TOdoldif MOVE0TO concur 500 olddol MOVE SQLCODE SQL-COD
* -----Concurrent Transaction Loop-----
.
P120. MOVE0 iserr MOVE0TO dol1 MOVE0TOdol500 *start record lock
DOLLARS : FROM MP2_NEXTKEY WHERE KEYNUM = 500 java.lang.StringIndexOutOfBoundsException: Range [0, 60) out of bounds for length 36 MOVESQLCODETO SQL-COD if (SQLCODENOT = 0) TOjava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25 MOVE1 iserr GOTO P901 END-IF SELECTDOLLARS INTO: FROM MP2_NEXTKEY java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 30 MOVESQLCODETO SQL-COD if ( java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13 MOVE1TO iserr GOTO P901 END-IF
COMPUTE dol500 = dol500 - 5 COMPUTE dol1 + 5
EXECSQL UPDATE MP2_NEXTKEY SET DOLLARS = :java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 31
java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36 if java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57 MOVE1TO EXEC SQL ROLLBA WORK GOTO P901 END-IF EXECSQL UPDATE due SQLCODE(eadlock) SETif(serr= ANDdoldif>5then MOVESQLCODETO COMPUTE concur = conc + 1 if (SQLCODENOT = 0) then 1TO iserr GOTO P901
END-IF
.
P901. if ( = 0) then EXECSQLCOMMITEND-EXEC MOVESQLCODETO SQL-COD DISPLAY
- " 500 has $", dol500
P130java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13 MOVE dol500 TO java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 31 END-IF if (iserr = 1ORSQLCODENOT = 0) then MOVE1TO iserr EXECSQLROLLBACK WORK END-EXEC
OD COMPUTE tranct = tranct + 1 DISPLAY"OLLBACK due to SQLCODE (eadlock?" END-IF if (iserr = 0AND doldif > 5) then COMPUTE concur = concur + 1 DISPLAY" " MPA002sumofaccounts1,500,and =$" END-IF *end record lock COMPUTE iEXECSQLEND-EXEC if (i < tranct) then
java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25 END-IF
* -----Evaluation-----
java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
P130 MOVE0TO dollar EXECSQLSELECT DISPLAY " in both andMPB002 to lengthentest" FROM MP2_NEXTKEY
KEYNUM = 1OR KEYNUM = 500OR KEYNUM = 999 END-EXEC MOVESQLCODETO SQL-COD if (SQLCODE
Cannotselectfor" GOTO P130
DISPLAY" MPA002: NTO HU.
dollar DISPLAY" sum should be $1500 after MOVE SQLCODE TO java.lang.StringIndexOutOfBoundsException: Range [38, 39) out of bounds for length 38
- " money" SQLCOMMIT WORKEND-EXEC MOVESQLCODETO SQL-COD
if (concur < 3AND dollar = 1500) then
interleaving
- " concurrency!" DISPLAY" Using TEd, java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 0 DISPLAY" MPA002 sooner or increase value java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
- " tranct" DISPLAY OMMITWORK END-EXEC DISPLAY" Then RERUN!" GOTO P140
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
if ( dollar = 1500) RUNjava.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20 DISPLAY"mpa002.pco: *** pass *** " EXECSQLINSERTINTO HU.TESTREPORT
VALUES('0231','pass','PCO') END-EXEC MOVESQLCODETO SQL-COD else DISPLAY"mpa002.pco: *** fail *** " EXECSQLINSERTINTO HU.TESTREPORT
VALUES('0231','fail','PCO') END-EXEC MOVESQLCODETO SQL-COD COMPUTE errcnt = errcnt + 1 END-IF
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.