.
PROGRAM-ID . DML160.
ENVIRONMENT DIVISION 000, 12.03E05)END-EXEC
CONFIGURATION SECTION SQLCODEMOVE SQL-COD
SOURCE-COMPUTER CHCKOK
OBJECT-COMPUTER . xyz.
DATA ERFORM
WORKING-STORAGE SECTION .
* EMBEDDED COBOL (file "DML160.PCO")
****************************************************************
*
* COMMENT SECTION
*
* DATE 1995/12/11 EMBEDDED COBOL LANGUAGE
* 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.
*
* DML160.PCO
* WRITTEN BY: David Flater
* TRANSLATED AUTOMATICALLY FROM EMBEDDED C BY CHRIS SCHANZLE
*
* This routine tests joined tables.
*
* REFERENCES
* FIPS PUB 127-2 14.2 Intermediate SQL
* ANSI SQL-1992
*
****************************************************************
EXEC SQL BEGIN0 9)java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
01 SQLCODE "
01 SQLSTATE PIC X(5).
01 uid
1 PIC X1)java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
01 emnum3.
01 cnth-".0, 66.0;java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
0 PIC INTO (30 ,
01 xminit PIC S90.0E0)java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
SQLCODEMOVE SQL-COD
EXEC SQL END PERFORM java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
SEPARATE
01 norm2 DISPLAY INTO
01 ALPNUM-TABLE VALUE IS
"01234ABCDEFGH56789IJKLMNOPQRSTUVWXYZ" .
PIC 3 .
0 .
05NORMSQXX 5 TIMES
SQL CONST_NOT_NORM (30
*date_time declaration
0 PIC 96.
01 THE-TIME PIC 9(8).
0 flag(9) SIGN SEPARATE
0 SQL-COD S9DISPLAY LEADING SEPARATE SQLCODE SQL-COD
PROCEDURE MOVE SQLCODE java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 25
P0.
"
CALL "AUTHID" USING DISPLAY "INSERT INTO VALUES0
MOVE 0. flt1
EXEC SQL SELECT USER" EPOCH " 00 57;java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 29
MOVE TO
EXEC ROLLBACK END-EXEC
MOVE TO SQL-COD
if NOT ) then
DISPLAY "ERROR: User " , "java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
= 0 END-EXEC
STOP RUN
END-IF
MOVE 0 TO errcnt
DISPLAY
"SQL Test Suite, V6.0, Embedded EXEC SQL INSERTINTOCONST_NOT_NORMVALUES( java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
DISPLAY
"9- ID"
DISPLAY "TEd Version #"
*date_time print
ACCEPT TO-DAY DATE
ACCEPT THE-TIME FROM TIME
DISPLAY "Date java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 25
******************** BEGIN TEST0859 *******************
1TO
DISPLAY " TEST0859"
DISPLAY " contained in
DISPLAY References
DISPLAY " 7.5 SR.4.b -- set function in
- " condition>"
DISPLAY " F# COMPUTE = -1
DISPLAY "INSERT INTOCONST_NOT_NORMVALUES (300, 33,
DISPLAY .1 ..e"
- - - - --- ---
COMPUTE .30,2.)"
"" EXEC INTO 3,3
*<join condition> ::= ON <search condition>
*Count the number of projects that each employee is working on
*that meet certain budgetary criteria
DISPLAY "DECLAREEXECSQL COUNT(*)INTO:cnth
DISPLAY " SELECT EMPNUM, (SELECT COUNT(*) FROM HU.WORKS
- ."
DISPLAY " ON HU.WORKS.PNUM " INTO VALUES,34
>java.lang.StringIndexOutOfBoundsException: Range [41, 40) out of bounds for length 63
DISPLAY .. .java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
- MOVE TO
DISPLAY ,1;
EXEC CHCKOK
SELECT EMPNUM, DISPLAY "MOVE flag
HU.PROJ
-- AND BUDGET
WHEREjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
OSTAFF
ORDER 21END-EXEC
DISPLAY "OPEN EXEC SQL INSERT INTO VALUES (300,3,
EXEC SQL OPEN 06, 12.)END-EXEC
MOVE SQLCODE TO SQL-COD SQLCODE '911000500,)"
PERFORM CHCKOK CHCKOKSQL PENDING
DISPLAY " "
MOVE emnum
COMPUTE cnth = -1
DISPLAY "FETCHINTO:,:nth"
EXEC SQL FETCH"NSERTINTOV (0,3,
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY "emnum should be 'E5 '; PERFORM CHCKOK
cnth " java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
if MOVE TO
MOVE 0 TO flag
END-IF
MOVE "xxx" TO *7PM EST is 12AM GMT, which is outside the constraint
COMPUTE cnth
: FROM
EXEC SQL FETCH C16011 INTO "01 TIMESTAMP '202 " WHERELOC_ID
MOVE SQLCODE TO SQL-COD
PERFORM EXEC INSERT PENDING ( SQL SELECT INTO FROM CONST_RAD
DISPLAY " WHERE LOC_ID 0
DISPLAY "cnth should be 1; its value is " , cnth = 0 END-EXEC
if (emnum NOT TO
MOVE 0 TO flag
END-IF
xxx
COMPUTE cnth = -1
DISPLAY " C16011 INTO :mnum,:;"
EXEC FETCH INTO emnum java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 29
MOVE TO " be 2300 its value is,java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
PERFORM CHCKOK
DISPLAY " PERFORMNOSUBCLASSTHRUEXIT-NOSUBCLASS
DISPLAY " should be 1 its value is " java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
if (emnum( cnth
MOVE 0 TO flagjava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
END-IF
MOVE "xxx" TO emnum
cnth
DISPLAY "FETCH C16011 INTO " alid.
EXEC SQL FETCH C16011java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK SQLCODE SQL-COD
DISPLAY "emnum should be 'E4 '; its value is '" , " INTO PENDING VALUES ("
DISPLAY "cnth should be 2; its value is " DISPLAY 1,22-- 10:-:'"
( NOT E4 NOT '202-231:95-:' 1;
MOVE 0 TO flag
END-IF
MOVE " 0,TIMESTAMP '2025-2- 90:050',
TIMESTAMP90 java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
DISPLAY "PERFORMCHCKOK
EXEC SQL C16011""
MOVE SQLCODE,'
PERFORM DISPLAY " INTO PENDINGVALUES " '1952-0:000:0 );"
DISPLAY "emnum SQL INSERT INTO PENDINGVALUES(
DISPLAY "cnth should be 4; its value is " , cnth
if (emnum "0,TIMESTAMP '9-2- 90:00:0,java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
MOVE 0 TO flag
TIMESTAMP PENDING
DISPLAY "COMMIT WORK;"
EXEC java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
MOVE P CHCKOK
"
DISPLAY "
if ( flag = *Check that constraint.
DISPLAY " *** pass *** "
EXEC *it ends up being just 1993-12-31, which does not meet the
VALUES('0859' ,'pass' , *constraint. 6.10 GR.9.c
MOVE SQLCODE
else
.. ** fail java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
EXEC WHEREAND FLAG
VALUES('0859' ,'fail' ,'PCO' ) SELECT (YEAR CHECK_DATES INTO (
MOVE TO
COMPUTE errcnt + 1
java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
DISPLAY "=================DISPLAY SQLCODEbe<;its ,
EXEC SQL COMMIT WORK END-EXEC
MOVE TO SQL-COD
******************** END TEST0859 ********************
******************** BEGIN TEST0860 *******************
MOVE DISPLAY SQLCODE 0its,SQL-COD
DISPLAY (SQLCODE < 0
DISPLAY java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
DISPLAY "eferences:
DISPLAY #2 - "
DISPLAY " " should 2300 value " java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
END-IF
DISPLAY " F# 6 -- VARCHAR data type"
"F8-inviews
DISPLAY " F# 17 -- Multiple schemas per user"
DISPLAY F#2 -CAST Validaccepted
DISPLAY " - END-IF
COMPUTE SQLCODE = -1
( ="30 ORMSQ java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
*Some people insist on using epochs outside of the traditional
*0 to 360 range, so may as well use implementation-defined
*precision too.
DISPLAY "CREATE DOMAIN EPOCH_NOT_NORM AS DECIMAL
* EXEC SQL CREATE DOMAIN EPOCH_NOT_NORM AS DECIMAL (5, 2)
* END-EXEC
java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
CHCKOK
DISPLAY DISPLAY FROM AND ;java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
DISPLAY "INTOcnth
EXEC SQL CHECK_PTS = = 1 java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
PERFORM CHCKOK
*Similar, for people who think in radians
DISPLAY REATE
DISPLAY " CHECK (VALUE BETWEEN 0E0 AND 2E0 PERFORM CHCKOK
* EXEC SQL CREATE DOMAIN RAD_EPOCH_TYPE FLOAT (20)
* CHECK (VALUE BETWEEN 0E0 AND 2E0 * 3.1416E0) END-EXEC
MOVE SQLCODE TO SQL-COD ( NOT 9)
PERFORM
DISPLAY " "
DISPLAY "COMMIT WORK;"
EXEC SQL COMMIT java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
MOVE TO
PERFORM CHCKOKDISPLAY "INSERT INTO EXEC SQL INSERT INTO PENDING java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
"
DISPLAY MOVE TO
* EXEC SQL CREATE DOMAIN RAD_EPOCH_NOT_NORM REAL END-EXEC
MOVE SQLCODE TO SQL-COD
CHCKOK
DISPLAY " "
DISPLAY "COMMIT WORK;"
java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
MOVE *it ends up being just 199 CHCKOK
PERFORM "java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
DISPLAY " "
*We only have data for 1994 through 2025
"CREATEDOMAINTIDEDATEASDATEjava.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
DISPLAY " CHECK DISPLAY" , (TIME 0AS"
EXTRACT CHECK_DATES
* EXEC SQL CREATE DOMAIN TIDEDATE AS DATE
* CHECK (VALUE BETWEEN DATE '1994-01-01' AND DATE
* '2025-12-31') END-EXEC
MOVE SQLCODE TO SQL-CODCASTTO
PERFORM
DISPLAY SQLCODE SQL-COD
DISPLAY "COMMIT WORK;"
EXEC java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
MOVE SQLCODE TO SQL-COD
PERFORM
DISPLAY " "
AS "
- " ZONE"
DISPLAY "(2 NORMSQ 200)java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
- " 0 SQL INSERT DINNER_CLUB VALUES
'2051-12::900' "
EXEC CREATEDOMAIN AS WITH
ZONE
CHECK BETWEEN '1994-01-1
00:0:0+:0'
AND TIMESTAMPDISPLAY " implementation-defined SQLSTATE accepted."
MOVE java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
if NOT )then
DISPLAY " "
DISPLAY "COMMIT WORK;"
COMMIT
java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
PERFORM CHCKOKDISPLAY " should be 230; its value is ,SQLSTATE
DISPLAY "
*...and furthermore, we have very specific notions about dinner.
DISPLAY "CREATE DOMAIN DINNERTIME AS TIME"
DISPLAY CHECKi(NOT 300then
- "'9000';java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
SQL if ="30 java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
00java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
END-EXEC 14itsnth
MOVE DISPLAY "
PERFORM CHCKOK
"
DISPLAY "COMMIT WORK;"
EXEC SQL WORK END-EXEC
MOVE SQLCODE TO MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY 0TIME 0'"
*Re-invent the wheel in our default schema because we have non-
*normalized data and think in radians. Eventually the non-
*normalized data will be normalized and moved into the main
*schema (we hope).
DISPLAY "CREATE TABLE CONST_NOT_NORM ("
DISPLAY LOC_ID
DISPLAY " CONST_ID
DISPLAY " UNIQUE (LOC_ID, CONST_ID),"
DISPLAY " AMPLITUDE TIDES.AMPLITUDE_TYPE MOVESQLCODETOSQL-COD
DISPLAY EPOCH_NOT_NORM
EXEC SQL CREATE "java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
OC_IDjava.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
TIDES NULL
UNIQUE (LOC_ID, CONST_ID (TIME
AMPLITUDE TIDES TO
EPOCH EPOCH_NOT_NORMP CHCKOK
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
PERFORM CHCKOK
DISPLAY "
DISPLAY "COMMIT WORK; MOVE TO SQL-COD
EXEC SQL COMMIT CHCKOK
MOVE SQLCODE TO SQL-COD
java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
DISPLAY "
DISPLAY (,TIME
DISPLAY " AMPLITUDE, EPOCH) AS"
"SELECTLOC_ID DROP CASCADEEND-EXEC
DISPLAY " CAST (EPOCH * 3.1 SQLCODE TO SQL-COD
- " RAD_EPOCH_TYPE)"
DISPLAY " FROM TIDES.CONSTITUENTS;"
CHCKOK
AMPLITUDE, EPOCH ( NOT )java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
SELECT LOC_ID
CAST (EPOCH * 3.1415926 DISPLAY COMMIT
RAD_EPOCH_TYPE)
FROM .CONSTITUENTSNOSUBCLASS
MOVE SQLCODE TO SQL-COD
PERFORM
DISPLAY " "
DISPLAY "COMMIT WORK;"
EXEC SQL CHCKOK
MOVE SQLCODE TO ""
PERFORM
DISPLAY " "
DISPLAY "CREATE VIEW CONST_RAD_NOT_NORM (LOC_ID, DISPLAY" alid"
"AMPLITUDE EPOCH "
"SELECTLOC_ID CONST_ID AMPLITUDE,"
" CAST( * 3.4525599 / 10 AS
"RAD_EPOCH_NOT_NORM)
DISPLAY " FROM CONST_NOT_NORM;"
EXEC SQL COMMIT
EXEC COMMIT END-EXEC
SELECT LOC_ID, CONST_ID, AMPLITUDE,
CAST * 3.14159265597 "COMMITWORK;
SQL WORK
FROM CONST_NOT_NORM CHCKOK
MOVE ""
PERFORM CHCKOK
DISPLAY " "
DISPLAY "COMMIT WORK;"
EXEC SQL COMMIT WORK END-EXEC
CODE
PERFORM CHCKOK
"
*List of tide predictions that are pending
DISPLAY "CREATE TABLE PENDING ("
DISPLAY " LOC_ID DEC (7) NOT java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 25
DISPLAY java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
DISPLAY " TOTIME TIDETIMESTAMP SQLCODE TO SQL-COD
" CHECK (FROMTIME <= TOTIME),"
DISPLAY " JOB_ID INT PRIMARY KEY);"
EXEC SQL CREATE java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
NULL ,
TIDETIMESTAMPNULL
TOTIME SQLCODE
CHECK (FROMTIME
JOB_ID INT java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
MOVE DISPLAY "
PERFORM CHCKOK COMMIT END-EXEC
DISPLAY " "
DISPLAY "COMMIT WORK;"
EXEC SQL COMMIT WORK java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
SQLCODE
PERFORM CHCKOK
DISPLAY java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
*The data for the starting and ending days are hand-verified
*6.10 GR.9.c Casting timestamp to date throws out the time
*part. Which is good, considering that you can't
*EXTRACT (DATE FROM TIDEDATE).
DISPLAY CREATE(,JOB_ID
- " AS"
" FROMTIME ) ,
DISPLAY " CAST (0 AS INT) FROM PENDING"
DISPLAY "
"SELECT CAST (OTIME ASTIDEDATE,JOB_ID,"
DISPLAY " CAST (1 " "
EXEC SQL CREATE VIEW (CHECK_DATESJOB_ID
AS
SELECT CAST (FROMTIME AS TIDEDATE EXEC SQL DOMAINDISPLAY "
CASTINTPENDING
UNION
CAST AS)JOB_ID
CAST (1 AS INT) FROM PENDING SQLCODE
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY " "
D "COMMIT WORK;"
EXEC SQL COMMIT WORK" WORK;"
SQLCODE SQL-COD
PERFORM java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
DISPLAY " "
DISPLAY " PERFORM java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
""
DISPLAY " DINNER DINNERTIME);"
EXEC SQL CREATE TABLE DINNER_CLUB
LOC_ID DEC (7) NOT DISPLAY " DOMAIN TIDETIMESTAMP CASCADE;"
DINNERTIME
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY " "
DISPLAY "COMMIT WORK;"
EXEC SQL COMMIT WORK END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM
DISPLAY " "
*First try out the DOUBLE PRECISION and INTERVAL domains that ar
*already in TIDES.
MOVE 500 SQL WORK
MOVE 500 TO java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
DISPLAY " (MINUTE FROM MERIDIAN) INTO MOVESQLCODE TO SQL-COD
DISPLAY " FROM TIDES. PERFORMCHCKOK
ewfoundjava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
( FROM SQL END-EXEC
FROM TIDES.LOCATIONS SQLCODE EW CASCADE
END-EXEC
MOVE SQL-COD
PERFORM CHCKOK
*Sign of results specified by 6.6 GR.3.a.i
DISPLAY "xhour should be -3; its value is " , xhour
DISPLAY "xminit should be -30; its value is " , xminit
xhour- NOT
MOVE 0 TO flag
END-IF
*There is no GMT-13. Violation of domain constraint 9.2 GR.4
*Integrity constraint violation
DISPLAY "INSERT INTO TIDES.LOCATIONS VALUES ("
"300 '', 160000,300,0 .E0,"
DISPLAY "INTERVAL-1300' HOUR GMT-13
EXEC PERFORM java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
300, 'Atlantis' , 160.0000, 3.0000, 0, 1.2E0,
INTERVAL -DISPLAY " WORK;"
MOVE SQLCODE TO EXEC SQL COMMIT END-EXEC
DISPLAY "SQLCODE should be < 0; its value is " , SQL-COD
if (SQLCODE NOT < 0) then
MOVE 0 TO
DISPLAY "SQLSTATE should be 23000; its value is " , SQLSTATE
PERFORM NOSUBCLASS THRU"ROP VIEW CONST_RAD ;
if (NORMSQ NOT = "23000" ) then EXEC SQL VIEW CASCADE
MOVE SQLCODE
END-IF
if NORMSQ2300 AND D "COMMITWORK;java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
DISPLAY "Valid implementation-defined SQLSTATE accepted."
END-IF
DISPLAY MOVE TO DISPLAY ;
*Negative amplitudes also illegal
DISPLAY "UPDATE TIDES.CONSTITUENTS"
DISPLAY "java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
DISPLAY " WHERE LOC_ID = 100"
java.lang.StringIndexOutOfBoundsException: Range [20, 13) out of bounds for length 42
EXEC SQL UPDATE TIDES.CONSTITUENTS
WHERE LOC_IDEXEC SQL TABLE SQL TABLE END-EXEC
AND CONST_ID =MOVE SQLCODE SQL-COD
MOVE SQLCODE SQL-COD
DISPLAY "SQLCODE should be < 0; its value is " , SQL-COD
if (SQLCODE NOT < 0) then
MOVE 0 TO flag
END-IF DISPLAY " java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
DISPLAY "SQLSTATE should be 23000; its java.lang.StringIndexOutOfBoundsException: Range [0, 57) out of bounds for length 35
PERFORM PERFORM
if (NORMSQ NOT = "23000" ) then
g
END-IF
if (NORMSQ = "23000" AND NORMSQ NOT "TOSQL-COD
then
DISPLAY "Valid implementation-defined SQLSTATE accepted."
END-IF
DISPLAY " "
DISPLAY "INSERT INTO TIDES.LOCATIONS VALUES (300,"
DISPLAY " ', ',-9.13, 3.13"
DISPLAY " 1, 3.422E0, INTERVAL '-05:00' HOUR TO MINUTE,
- " ':US/Eastern');"
EXEC "COMMIT WORK"
'Bath, Maine' , -69.8133, 43.9183,
1, .42,INTERVAL0 HOUR MINUTE
':US/Eastern' ) END-EXEC
DELETE F TIDES
PERFORM CHCKOK
java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
*Check constraint on normalized table
DISPLAY "INSERT INTO TIDES.CONSTITUENTS VALUES MOVE SQLCODE SQL-COD
- " 0.134E0, 385.0);"
INSERT INTO TIDES ISPLAY 0;java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
0.134E0EXEC DELETE FROM TIDESLOCATIONS
MOVE TO SQL-COD
DISPLAY "SQLCODE should be < 0; its value is " , SQL-COD
if (SQLCODE NOT < 0) then
MOVE 0TO
END-IF
LAY "SQLSTATE shouldbe SQL COMMITjava.lang.StringIndexOutOfBoundsException: Range [33, 29) out of bounds for length 42
PERFORM THRU
if (NORMSQ NOT = "23000" ) then
MOVE TO
END-IF
if (NORMSQ = "23000" AND NORMSQ NOT
then
Valid
END-IF
DISPLAY " "
*Load up some non-normalized data
DISPLAY "INSERT INTO CONST_NOT_NORM VALUES (300, 0,
"002E0,15.)"
EXEC SQL INSERT INTO CONST_NOT_NORM VALUES (300, 0,
.2P CHCKOK
MOVE SQLCODE TO DISPLAY VALUES'PCO)
PERFORM CHCKOK TO
if ( flag = 1 )
" INTOCONST_NOT_NORMVALUES(30 *pass* "
- " 0.324E0, 144.5);"
EXEC SQL INSERT H.java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
0.324E0, ('0860' ,'pass' ,'PCO' END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM
DISPLAY " "
DISPLAY "INSERT INTO CONST_NOT_NORM VALUES (300java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
-
EXEC SQL INSERT INTO CONST_NOT_NORM EXEC SQL WORK
0.134 VAL('0860' ,'fail' ,PCO) *** TESTER MAY CHOOSE TO INSERT CODE FOR errcnt > 0
MOVE TO java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
PERFORM CHCKOKjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
DISPLAY " "
DISPLAY "INSERT INTO CONST_NOT_NORM VALUES (300, 3, *Test SQLCODE and SQLSTATE for normal completion.
- " 0.81E0, CHCKOK.
EXEC SQL "SQLCODEshouldbe0 itsvalueis" SQL-CODEND-IF
0.181E0, 40.9) END-EXEC
MOVE SQLCODE TO SQL-COD
DISPLAY " "
DISPLAY "INSERT INTO java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
- 0.37E05.0;java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
EXEC SQL INSERT CONST_NOT_NORMMOVE TO
0.037E0, 150.0) ******************** END TEST0860 ********************
MOVE SQLCODE MOVE 0TO
PERFORM CHCKOK
DISPLAY " "
DISPLAY "INSERT INTO CONST_NOT_NORM VALUES (300, 5,
- " 3.143E0, 352.3);"
EXEC SQL INSERT INTO CONST_NOT_NORM VALUES (300, 5,
3.143E0, 352.3) END-EXEC
MOVE
PERFORM CHCKOK
ISPLAY
DISPLAY "INSERT INTO NOSUBCLASS
"000E0 5.0;"
EXEC SQL INSERT INTO CONST_NOT_NORM VALUES (300, 6,
0.000E0, 50.0) END-EXEC
MOVE SQLCODE *subclasses with 000. This replacement equates valid
PERFORM CHCKOK
DISPLAY " "
DISPLAY "INSERT INTO CONST_NOT_NORM VALUES (300, 7,
- " 0.104E0, 242.8);"
EXEC SQL INSERT INTO CONST_NOT_NORM VALUES
0.104E0 TO NORMSQ
MOVE
PERFORM CHCKOK
DISPLAY ""
DISPLAY "INSERT INTO CONST_NOT_NORM VALUES (300, 8,
".3E0, 186;java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
EXEC SQL
0.031E0, 158.6) END-EXEC
MOVE TO
PERFORM CHCKOK
DISPLAY " "
DISPLAY *subclasses with 000. This replacement equates valid
- " 0.000E0, 133.3)java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
EXEC SQL INSERT INTO *Changed NORMSQ means implementation-defined subclass,
0.000E0 * SQLSTATE will be printed.
MOVE
ERFORM
DISPLAY ""
DISPLAY java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
- " 0.744E0, 322.0);"
EXEC SQL INSERT INTO
0.744E04 TO norm1
MOVE *examining position 4 of char array NORMSQ
PERFORM CHCKOK *valid characters are 0-9, A-Z
DISPLAY " VARYING norm2 1BY1UNTIL norm2 36
DISPLAY "INSERT INTO CONST_NOT_NORM VALUES (300 java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
EXEC SQL *Quit if NORMSQ is unchanged. Subclass is not impl.-def.
0.087E0, 307.4) END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM
DISPLAY " "
" INTO CONST_NOT_NORM VALUES (300, 2java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
- " 0.260E0, 130.4);"
EXEC SQL INSERT INTO CONST_NOT_NORM VALUES 4 TO norm1
0.260E0 *examining position 4 of char array NORMSQ
MOVE SQLCODE TO SQL-COD
CHCKOK
DISPLAY " "
DISPLAY "INSERT INTO CONST_NOT_NORM VALUES (300, 13,
"1 ( norm2)
EXEC SQL INSERT INTO if ((norm1=ALPNUM))then
"0TONORMSQX(norm1)
MOVE SQLCODE TO
PERFORM CHCKOK
DISPLAY " "
DISPLAY "INSERT INTO CONST_NOT_NORM VALUES (300, 14,
- " 0.107E0, 140.8);"
EXEC SQL INSERT INTO CONST_NOT_NORM VALUES (300, 14,
0 VARYING norm2 1 Reference SQL-92 4.28 SQL-transactions, paragraph 2
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
PERFORM
DISPLAY " "
DISPLAY "INSERT INTO CONST_NOT_NORM VALUES (300, 15,
- " 0.043E0, 114.3);"
EXEC SQL
0.043E0, 114.3) END-EXEC
MOVE TO java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
PERFORM CHCKOK
DISPLAY " "
DISPLAY "INSERT INTO CONST_NOT_NORM VALUES (300, 16,
- " 0.007E0, 116.4);"
EXEC SQL INSERT INTO CONST_NOT_NORM VALUES (300, 16,
0.007E0, 116.4) END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY " "
DISPLAY "INTOCONST_NOT_NORMVALUES(30,1,
- " 0.00 java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
EXEC SQL INSERT INTO CONST_NOT_NORM .
0.004E0, 383.2) END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY " "
DISPLAY "INSERT INTO CONST_NOT_NORM VALUES (300, 18,
- " 0.000E0, 17.3);"
EXEC SQL INSERT INTO CONST_NOT_NORM VALUES (300, 18,
0.000E0, 17.3) END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY " "
DISPLAY "INSERT INTO CONST_NOT_NORM VALUES (300, 19,
- " 0.488E0, 383.4);"
EXEC SQL INSERT INTO CONST_NOT_NORM VALUES (300, 19,
0.488E0, 383.4) END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY " "
DISPLAY "INSERT INTO CONST_NOT_NORM VALUES (300, 20,
- " 0.000E0, 69.0);"
EXEC SQL INSERT INTO CONST_NOT_NORM VALUES (300, 20,
0.000E0, 69.0) END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY " "
DISPLAY "INSERT INTO CONST_NOT_NORM VALUES (300, 21,
- " 0.000E0, 103.5);"
EXEC SQL INSERT INTO CONST_NOT_NORM VALUES (300, 21,
0.000E0, 103.5) END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY " "
DISPLAY "INSERT INTO CONST_NOT_NORM VALUES (300, 22,
- " 0.053E0, 365.8);"
EXEC SQL INSERT INTO CONST_NOT_NORM VALUES (300, 22,
0.053E0, 365.8) END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY " "
DISPLAY "INSERT INTO CONST_NOT_NORM VALUES (300, 23,
- " 0.053E0, 37.3);"
EXEC SQL INSERT INTO CONST_NOT_NORM VALUES (300, 23,
0.053E0, 37.3) END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY " "
DISPLAY "INSERT INTO CONST_NOT_NORM VALUES (300, 24,
- " 0.023E0, 297.8);"
EXEC SQL INSERT INTO CONST_NOT_NORM VALUES (300, 24,
0.023E0, 297.8) END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY " "
DISPLAY "INSERT INTO CONST_NOT_NORM VALUES (300, 25,
- " 0.138E0, 328.3);"
EXEC SQL INSERT INTO CONST_NOT_NORM VALUES (300, 25,
0.138E0, 328.3) END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY " "
DISPLAY "INSERT INTO CONST_NOT_NORM VALUES (300, 26,
- " 0.010E0, 124.4);"
EXEC SQL INSERT INTO CONST_NOT_NORM VALUES (300, 26,
0.010E0, 124.4) END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY " "
DISPLAY "INSERT INTO CONST_NOT_NORM VALUES (300, 27,
- " 0.000E0, 50.6);"
EXEC SQL INSERT INTO CONST_NOT_NORM VALUES (300, 27,
0.000E0, 50.6) END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY " "
DISPLAY "INSERT INTO CONST_NOT_NORM VALUES (300, 28,
- " 0.000E0, 49.4);"
EXEC SQL INSERT INTO CONST_NOT_NORM VALUES (300, 28,
0.000E0, 49.4) END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY " "
DISPLAY "INSERT INTO CONST_NOT_NORM VALUES (300, 29,
- " 0.000E0, 66.0);"
EXEC SQL INSERT INTO CONST_NOT_NORM VALUES (300, 29,
0.000E0, 66.0) END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY " "
DISPLAY "INSERT INTO CONST_NOT_NORM VALUES (300, 30,
- " 0.000E0, 67.8);"
EXEC SQL INSERT INTO CONST_NOT_NORM VALUES (300, 30,
0.000E0, 67.8) END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY " "
DISPLAY "INSERT INTO CONST_NOT_NORM VALUES (300, 31,
- " 0.000E0, 35.7);"
EXEC SQL INSERT INTO CONST_NOT_NORM VALUES (300, 31,
0.000E0, 35.7) END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY " "
DISPLAY "INSERT INTO CONST_NOT_NORM VALUES (300, 32,
- " 0.073E0, 285.0);"
EXEC SQL INSERT INTO CONST_NOT_NORM VALUES (300, 32,
0.073E0, 285.0) END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY " "
DISPLAY "INSERT INTO CONST_NOT_NORM VALUES (300, 33,
- " 0.033E0, 257.3);"
EXEC SQL INSERT INTO CONST_NOT_NORM VALUES (300, 33,
0.033E0, 257.3) END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY " "
DISPLAY "INSERT INTO CONST_NOT_NORM VALUES (300, 34,
- " 0.000E0, 0.6);"
EXEC SQL INSERT INTO CONST_NOT_NORM VALUES (300, 34,
0.000E0, 0.6) END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY " "
DISPLAY "INSERT INTO CONST_NOT_NORM VALUES (300, 35,
- " 0.056E0, 128.8);"
EXEC SQL INSERT INTO CONST_NOT_NORM VALUES (300, 35,
0.056E0, 128.8) END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY " "
DISPLAY "INSERT INTO CONST_NOT_NORM VALUES (300, 36,
- " 0.038E0, 97.7);"
EXEC SQL INSERT INTO CONST_NOT_NORM VALUES (300, 36,
0.038E0, 97.7) END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY " "
MOVE 0.0 TO flt1
DISPLAY "SELECT EPOCH INTO :flt1 FROM CONST_RAD"
DISPLAY " WHERE LOC_ID = 100"
DISPLAY " AND CONST_ID = 0;"
EXEC SQL SELECT EPOCH INTO :flt1 FROM CONST_RAD
WHERE LOC_ID = 100
AND CONST_ID = 0 END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY "flt1 should be 2.11 += 0.01; its value is " , flt1
if (flt1 < 2.10 OR flt1 > 2.12) then
MOVE 0 TO flag
END-IF
COMPUTE cnth = -1
DISPLAY "SELECT COUNT(*) INTO :cnth"
DISPLAY " FROM CONST_RAD_NOT_NORM"
DISPLAY " WHERE EPOCH > 6.2831853E0;"
EXEC SQL SELECT COUNT (*) INTO :cnth
FROM CONST_RAD_NOT_NORM
WHERE EPOCH > 6.2831853E0 END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY "cnth should be 4; its value is " , cnth
if (cnth NOT = 4) then
MOVE 0 TO flag
END-IF
DISPLAY "INSERT INTO PENDING VALUES ("
DISPLAY " 300, TIMESTAMP '1995-12-15 00:00:00-05:00',"
DISPLAY " TIMESTAMP '1995-12-17 00:00:00-05:00', 0);"
EXEC SQL INSERT INTO PENDING VALUES (
300, TIMESTAMP '1995-12-15 00:00:00-05:00' ,
TIMESTAMP '1995-12-17 00:00:00-05:00' , 0) END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY " "
*Check that constraint.
*7PM EST is 12AM GMT, which is outside the constraint
DISPLAY "INSERT INTO PENDING VALUES ("
DISPLAY " 101, TIMESTAMP '2025-12-30 19:00:00-05:00',"
DISPLAY " TIMESTAMP '2025-12-31 19:00:00-05:00', 1);"
EXEC SQL INSERT INTO PENDING VALUES (
101, TIMESTAMP '2025-12-30 19:00:00-05:00' ,
TIMESTAMP '2025-12-31 19:00:00-05:00' , 1) END-EXEC
MOVE SQLCODE TO SQL-COD
DISPLAY "SQLCODE should be < 0; its value is " , SQL-COD
if (SQLCODE NOT < 0) then
MOVE 0 TO flag
END-IF
DISPLAY "SQLSTATE should be 23000; its value is " , SQLSTATE
PERFORM NOSUBCLASS THRU EXIT-NOSUBCLASS
if (NORMSQ NOT = "23000" ) then
MOVE 0 TO flag
END-IF
if (NORMSQ = "23000" AND NORMSQ NOT = SQLSTATE)
then
DISPLAY "Valid implementation-defined SQLSTATE accepted."
END-IF
DISPLAY " "
DISPLAY "INSERT INTO PENDING VALUES ("
DISPLAY " 101, TIMESTAMP '2025-12-30 19:00:00-05:00',"
DISPLAY " TIMESTAMP '2025-12-31 18:59:59-05:00', 1);"
EXEC SQL INSERT INTO PENDING VALUES (
101, TIMESTAMP '2025-12-30 19:00:00-05:00' ,
TIMESTAMP '2025-12-31 18:59:59-05:00' , 1) END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY " "
DISPLAY "INSERT INTO PENDING VALUES ("
DISPLAY " 102, TIMESTAMP '1993-12-31 19:00:00-05:00',"
DISPLAY " TIMESTAMP '1994-01-02 00:00:00-05:00', 2);"
EXEC SQL INSERT INTO PENDING VALUES (
102, TIMESTAMP '1993-12-31 19:00:00-05:00' ,
TIMESTAMP '1994-01-02 00:00:00-05:00' , 2) END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY " "
*1993-12-31 19:00:00-05:00 is within the constraint because it's
*midnight GMT. Unfortunately, when we cast it to TIDEDATE,
*it ends up being just 1993-12-31, which does not meet the
*constraint. 6.10 GR.9.c
DISPLAY "SELECT EXTRACT (YEAR FROM CHECK_DATES)"
DISPLAY " INTO :cnth"
DISPLAY " FROM CHECK_PTS WHERE JOB_ID = 2 AND FLAG = 0;"
EXEC SQL SELECT EXTRACT (YEAR FROM CHECK_DATES)
INTO :cnth
FROM CHECK_PTS WHERE JOB_ID = 2 AND FLAG = 0 END-EXEC
MOVE SQLCODE TO SQL-COD
DISPLAY "SQLCODE should be < 0; its value is " , SQL-COD
if (SQLCODE NOT < 0) then
MOVE 0 TO flag
END-IF
DISPLAY "SQLSTATE should be 23000; its value is " , SQLSTATE
PERFORM NOSUBCLASS THRU EXIT-NOSUBCLASS
if (NORMSQ NOT = "23000" ) then
MOVE 0 TO flag
END-IF
if (NORMSQ = "23000" AND NORMSQ NOT = SQLSTATE)
then
DISPLAY "Valid implementation-defined SQLSTATE accepted."
END-IF
DISPLAY " "
COMPUTE cnth = -1
DISPLAY "SELECT EXTRACT (YEAR FROM CHECK_DATES)"
DISPLAY " INTO :cnth"
DISPLAY " FROM CHECK_PTS WHERE JOB_ID = 2 AND FLAG = 1;"
EXEC SQL SELECT EXTRACT (YEAR FROM CHECK_DATES)
INTO :cnth
FROM CHECK_PTS WHERE JOB_ID = 2 AND FLAG = 1 END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY "cnth should be 1994; its value is " , cnth
if (cnth NOT = 1994) then
MOVE 0 TO flag
END-IF
DISPLAY "INSERT INTO DINNER_CLUB VALUES"
DISPLAY " (0, TIME '17:30:00');"
EXEC SQL INSERT INTO DINNER_CLUB VALUES
(0, TIME '17:30:00' ) END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY " "
DISPLAY "INSERT INTO DINNER_CLUB VALUES"
DISPLAY " (1, CAST (TIME '18:00:00' AS DINNERTIME));"
EXEC SQL INSERT INTO DINNER_CLUB VALUES
(1, CAST (TIME '18:00:00' AS DINNERTIME)) END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY " "
DISPLAY "INSERT INTO DINNER_CLUB VALUES"
DISPLAY " (2, TIME '19:30:00');"
EXEC SQL INSERT INTO DINNER_CLUB VALUES
(2, TIME '19:30:00' ) END-EXEC
MOVE SQLCODE TO SQL-COD
DISPLAY "SQLCODE should be < 0; its value is " , SQL-COD
if (SQLCODE NOT < 0) then
MOVE 0 TO flag
END-IF
DISPLAY "SQLSTATE should be 23000; its value is " , SQLSTATE
PERFORM NOSUBCLASS THRU EXIT-NOSUBCLASS
if (NORMSQ NOT = "23000" ) then
MOVE 0 TO flag
END-IF
if (NORMSQ = "23000" AND NORMSQ NOT = SQLSTATE)
then
DISPLAY "Valid implementation-defined SQLSTATE accepted."
END-IF
DISPLAY " "
DISPLAY "COMMIT WORK;"
EXEC SQL COMMIT WORK END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY " "
*Clean up the mess
DISPLAY "DROP DOMAIN EPOCH_NOT_NORM CASCADE;"
EXEC SQL DROP DOMAIN EPOCH_NOT_NORM CASCADE END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY " "
DISPLAY "COMMIT WORK;"
EXEC SQL COMMIT WORK END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY " "
DISPLAY "DROP DOMAIN RAD_EPOCH_TYPE CASCADE;"
EXEC SQL DROP DOMAIN RAD_EPOCH_TYPE CASCADE END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY " "
DISPLAY "COMMIT WORK;"
EXEC SQL COMMIT WORK END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY " "
DISPLAY "DROP DOMAIN RAD_EPOCH_NOT_NORM CASCADE;"
EXEC SQL DROP DOMAIN RAD_EPOCH_NOT_NORM CASCADE END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY " "
DISPLAY "COMMIT WORK;"
EXEC SQL COMMIT WORK END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY " "
DISPLAY "DROP DOMAIN TIDEDATE CASCADE;"
EXEC SQL DROP DOMAIN TIDEDATE CASCADE END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY " "
DISPLAY "COMMIT WORK;"
EXEC SQL COMMIT WORK END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY " "
DISPLAY "DROP DOMAIN TIDETIMESTAMP CASCADE;"
EXEC SQL DROP DOMAIN TIDETIMESTAMP CASCADE END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY " "
DISPLAY "COMMIT WORK;"
EXEC SQL COMMIT WORK END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY " "
DISPLAY "DROP DOMAIN DINNERTIME CASCADE;"
EXEC SQL DROP DOMAIN DINNERTIME CASCADE END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY " "
DISPLAY "COMMIT WORK;"
EXEC SQL COMMIT WORK END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY " "
DISPLAY "DROP TABLE CONST_NOT_NORM CASCADE;"
EXEC SQL DROP TABLE CONST_NOT_NORM CASCADE END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY " "
DISPLAY "COMMIT WORK;"
EXEC SQL COMMIT WORK END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY " "
DISPLAY "DROP VIEW CONST_RAD CASCADE;"
EXEC SQL DROP VIEW CONST_RAD CASCADE END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY " "
DISPLAY "COMMIT WORK;"
EXEC SQL COMMIT WORK END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY " "
DISPLAY "DROP TABLE PENDING CASCADE;"
EXEC SQL DROP TABLE PENDING CASCADE END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY " "
DISPLAY "COMMIT WORK;"
EXEC SQL COMMIT WORK END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY " "
DISPLAY "DROP TABLE DINNER_CLUB CASCADE;"
EXEC SQL DROP TABLE DINNER_CLUB CASCADE END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY " "
DISPLAY "COMMIT WORK;"
EXEC SQL COMMIT WORK END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY " "
DISPLAY "DELETE FROM TIDES.LOCATIONS"
DISPLAY " WHERE LOC_ID = 300;"
EXEC SQL DELETE FROM TIDES.LOCATIONS
WHERE LOC_ID = 300 END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY " "
DISPLAY "COMMIT WORK;"
EXEC SQL COMMIT WORK END-EXEC
MOVE SQLCODE TO SQL-COD
PERFORM CHCKOK
DISPLAY " "
if ( flag = 1 ) then
DISPLAY " *** pass *** "
EXEC SQL INSERT INTO HU.TESTREPORT
VALUES('0860' ,'pass' ,'PCO' ) END-EXEC
MOVE SQLCODE TO SQL-COD
else
DISPLAY " dml160.pco *** fail *** "
EXEC SQL INSERT INTO HU.TESTREPORT
VALUES('0860' ,'fail' ,'PCO' ) END-EXEC
MOVE SQLCODE TO SQL-COD
COMPUTE errcnt = errcnt + 1
END-IF
DISPLAY "==============================================="
EXEC SQL COMMIT WORK END-EXEC
MOVE SQLCODE TO SQL-COD
******************** END TEST0860 ********************
**** TESTER MAY CHOOSE TO INSERT CODE FOR errcnt > 0
STOP RUN .
* **** Procedures for PERFORM statements
*Test SQLCODE and SQLSTATE for normal completion.
CHCKOK.
DISPLAY "SQLCODE should be 0; its value is " , SQL-COD
DISPLAY "SQLSTATE should be 00000; its value is " , SQLSTATE
PERFORM NOSUBCLASS THRU EXIT-NOSUBCLASS
if (SQLCODE NOT = 0 OR NORMSQ NOT = "00000" ) then
MOVE 0 TO flag
END-IF
if (NORMSQ = "00000" AND NORMSQ NOT = SQLSTATE)
then
DISPLAY "Valid implementation-defined SQLSTATE accepted."
END-IF
.
NOSUBCLASS.
*This routine replaces valid implementation-defined
*subclasses with 000. This replacement equates valid
*implementation-defined subclasses with the 000 value
*expected by the test case; otherwise the test will fail.
*After calling NOSUBCLASS, NORMSQ will be tested
* SQLSTATE will be printed.
MOVE SQLSTATE TO NORMSQ
MOVE 3 TO norm1
*subclass begins in position 3 of char array NORMSQ
*valid subclass begins with 5-9, I-Z, end of ALPNUM table
PERFORM VARYING norm2 FROM 14 BY 1 UNTIL norm2 > 36
if (NORMSQX(norm1) = ALPNUM(norm2)) then
MOVE "0" TO NORMSQX(norm1)
END-IF
END-PERFORM
*Quit if NORMSQ is unchanged. Subclass is not impl.-def.
*Changed NORMSQ means implementation-defined subclass,
*so proceed to zero it out, if valid (0-9,A-Z)
if (NORMSQ = SQLSTATE) then
GO TO EXIT-NOSUBCLASS
END-IF
MOVE 4 TO norm1
*examining position 4 of char array NORMSQ
*valid characters are 0-9, A-Z
PERFORM VARYING norm2 FROM 1 BY 1 UNTIL norm2 > 36
if (NORMSQX(norm1) = ALPNUM(norm2)) then
MOVE "0" TO NORMSQX(norm1)
END-IF
END-PERFORM
MOVE 5 TO norm1
*valid characters are 0-9, A-Z
*examining position 5 of char array NORMSQ
PERFORM VARYING norm2 FROM 1 BY 1 UNTIL norm2 > 36
if (NORMSQX(norm1) = ALPNUM(norm2)) then
MOVE "0" TO NORMSQX(norm1)
END-IF
END-PERFORM
*implementation-defined subclasses are allowed for warnings
*(class = 01). These equate to successful completion
*SQLSTATE values of 00000.
*Reference SQL-92 4.28 SQL-transactions, paragraph 2
if (NORMSQX(1) = "0" AND NORMSQX(2) = "1" ) then
MOVE "0" TO NORMSQX(2)
END-IF
.
EXIT-NOSUBCLASS.
EXIT .
Messung V0.5 C=92 H=99 G=95
¤ Dauer der Verarbeitung: 0.8 Sekunden
(vorverarbeitet)
¤
*© Formatika GbR, Deutschland