*Copyright 1995 National Computing Centre Limited *and Computer Logic R&D S.A *on behalf of the CTS5 SQL2 Project. *All rights reserved. *The CTS5 SQL2 Project is sponsored by the European Community. * *The National Computing Centre Limited and Computer Logic R&D *have given permission to NIST to distribute this program *over the World Wide Web in order to promote SQL standards. *DISCLAIMER: *This program was reviewed by employees of NIST for *conformance to the SQL standards. *NIST assumes no responsibility for any party's use of *this program.
**************************************************************** * * COMMENT SECTION * * SQL VALIDATION TEST SUITE V6.0 * * XTS726.PCO * WRITTEN BY: Nickos Backalidis * TRANSLATED AUTOMATICALLY FROM EMBEDDED C BY CHRIS SCHANZLE * * Flagging - Full SQL - cursor with FOR UPDATE and ORDER BY * * REFERENCES * 13.1 -- <declare cursor> * 13.9 -- <update statement: positioned> * 13.10 -- <update statement: searched> * 13.9 SR.4 * F#37 -- Intermediate SQL Flagging * * DATE LAST ALTERED 14/12/95 CTS5 Hand-over Test * * Cleanups and fixes by V. Kogakis 04/12/95: * Change values returned from table CL_STANDARD * (JIM > MORRIS) * * QA Status: QA CHECK * * Revised by DWF 1/31/96 * Removed status checks after cursor definition * Fixed char string lengths * Fixed misinterpretations of SQL-92 * Harmonized printfs with executed statements * Corrected expected results ****************************************************************
EXECSQL BEGIN DECLARE SECTIONEND-EXEC * 01 SQLSTATE PIC X(5). 01 uid PIC X(18). 01 uidx PIC X(18). 01 c_num1 PIC S9(9) DISPLAYSIGNLEADINGSEPARATE* Revised by DWF 1/31/96 01 c_num2 PIC S9(9) DISPLAYSIGNLEADINGSEPARATE. 01 c_ch1 PIC X(10). 01 c_ch2 PIC X(10).
**************************************java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 01 norm1 PIC S9(9) DISPLAYSIGNLEADINGSEPARATE.
(9) DISPLAYSIGNLEADING . 01 ALPNUM-TABLE VALUEIS "01234ABCDEFGH56789IJKLMNOPQRSTUVWXYZ". 05 ALPNUM PIC X OCCURS36 TIMES0118) 01 . 05 NORMSQX PIC X OCCURS5 TIMES. 01 S9) SIGNLEADINGSEPARATEjava.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58 *date_time declaration
X10. EXECSQLENDSECTIONEND-EXEC 01 flagPICS99)DISPLAYSIGNLEADINGSEPARATE.
01 SQL-COD PIC S9(9) DISPLAYSIGNLEADINGSEPARATE.
PROCEDUREDIVISION.
P0.
MOVECTS1"TOjava.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45 CALL"AUTHID 01234ABCDEFGH56789IJKLMNOPQRSTUVWXYZ. MOVE . EXEC05java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 44 MOVESQLCODETO SQL-COD EXECSQL01 (java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27 TOSQL-COD
01 SQL-COD 9DISPLAYLEADING. DISPLAY"ERROR: User ", uid
- " connected STOP
MOVE0TO errcnt
DISPLAY"SQL Test Suite, V6.0, Embedded COBOL, xts726.pco" DISPLAY "59-byte ID" DISPLAY"TEd Version #" *date_time print ACCEPT TO-DAY FROMDATE ACCEPT THE-TIME FROMSQLEND-EXEC
AY"ate run "THE-TIME
***************** BEGIN TEST7026 ***************** MOVE flag
DISPLAY" TEST7026 " DISPLAY" Flagging Full STOP java.lang.StringIndexOutOfBoundsException: Range [20, 21) out of bounds for length 20
-"ORDER " DISPLAY"java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 20 DISPLAY . -<eclarecursor" DISPLAY" 13.9 -- *date_time print DISPLAY" 13.10 -- <update statement: java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 36 DISPLAY" 139 4" DISPLAY" F#37 -- Intermediate SQL Flagging " DISPLAY" - - - - - - - - -java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
*Subtest 1
*Initialise error reporting variables COMPUTEjava.lang.StringIndexOutOfBoundsException: Range [30, 28) out of bounds for length 33 MOVE"xxxxx""
*use table CL_STANDARD from the standard schema *Use Valid Intermediate SQL & declare a cursor *for UPDATE only DISPLAY"Valid Intermediate SQL syntax:" DISPLAY"DECLARE ALPHA CURSOR FOR SELECT "F - Flagging DISPLAY"OL_CH1,OL_NUM2,OL_CH2" DISPLAY"FROM CL_STANDARD " DISPLAY"WHERE COL_NUM1 = 1004 AND COL_CH1 = 'MORRIS'" DISPLAY"FOR UPDATEjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 EXECSQL DECLARE ALPHA CURSOR FORSELECT xxxxx SQLSTATE
COL_CH1, *use table CL_STANDARD from the standard schema WHERE COL_NUM1 = 1004*for UPDATE only
DISPLAY DECLARE CURSORFORCOL_NUM1"
*initialise host variables MOVE"xxxxxxxxxx"TO c_ch1 MOVE"xxxxxxxxxx"TO c_ch2
0 MOVE0TO c_num2 DISPLAY" FOR UPDATECOL_CH1,
- " :S OPENALPHA EXECMOVESQLCODETO SQL-COD END-EXEC MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"Values of the columns BEFORE the UPDATE:" DISPLAY"COL_NUM1 = ", c_num1, " MOVE TO DISPLAY"COL_NUM2 = ", c_num2, " COL_CH2 = ", c_ch2 DISPLAY" "
*use an <update statement:positioned and modify row *that satisfies the <search condition> of the query DISPLAYMOVEjava.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 36 DISPLAY"SET COL_CH1 = 'ELLIE', COL_NUM2 = COL_NUM2 + 10" DISPLAY"WHERE CURRENT OF ALPHA;" EXECSQL UPDATE CL_STANDARD SET COL_CH1 = 'ELLIE', *that satisfies the <search condition> of the query WHERE CURRENT OF ALPHA END-EXEC MOVESQLCODETOSQL-COD PERFORM CHCKOK DISPLAY" "
*close the cursor DISPLAY"ALPHA; EXECSQLCLOSE COL_CH1=E'COL_NUM2 +java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61 MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY" "
*use a <select statement: single row> and check that *the row has been successfully modified DISPLAY"SELECTjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 DISPLAY"INTO :c_num1, :c_ch1, c_num2, c_ch2" DISPLAY"FROM CL_STANDARD" DISPLAY"WHERE COL_NUM1 = 1004;" EXECSQLSELECT INTO :c_num1,:c_ch1,:c_num2,:c_ch2 *the row has been successfully modified FROM CL_STANDARD INTO:ch1c_num2java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58 WHERE COL_NUM1DISPLAY"HERECOL_NUM1=1004;" MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY" INTO:c_num1,c_ch1,c_num2,c_ch2 DISPLAY"COL_NUM1 should be 1004; it is ", DISPLAY"COL_CH1 should be ELLIE; it isPERFORM CHCKOK "COL_NUM2 should 4014; it is ,c_num2,"" DISPLAY"COL_CH2 should be PARGA; it is ", c_ch2, " " if (c_num1 NOT = 1004OR c_ch1 NOT = "ELLIE"OR
c_num2 NOT = 4014) then MOVE0TO END-IF if (c_ch2 NOT = "PARGA") "OL_CH2be is ,c_ch2," java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68 MOVE0TO flag END-IF DISPLAY" "
*restore CL_STANDARD in its original state DISPLAY"ROLLBACK WORK;" EXECSQLROLLBACK WORK END-EXEC MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY" "
*Subtest 2 DISPLAY"FULL SQL SYNTAX:" DISPLAY"DECLARE BETA CURSOR FOR SELECT" DISPLAY"COL_NUM1,COL_CH1,COL_NUM2 FROM CL_STANDARDPERFORM DISPLAY"WHERE java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 DISPLAY"ORDER BY COL_NUM2 DESC FOR UPDATE java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 53
DECLARE FOR
COL_NUM1,COL_CH1,COL_NUM2 FROM CL_STANDARD WHERE DISPLAY "WHERE COL_NUM1 = 1001" BY java.lang.StringIndexOutOfBoundsException: Range [60, 59) out of bounds for length 68
DISPLAYF BETA INTO:n :c_ch1,:_um2;java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65 EXECSQL FETCH BETA *fetch the row
MOVE xxxxxxxxxx java.lang.StringIndexOutOfBoundsException: Range [39, 40) out of bounds for length 39 PERFORM CHCKOK DISPLAY"shouldbe is "c_num1 DISPLAY"COL_CH1 should be MARIA it is ", c_ch1, " " DISPLAY"COL_NUM2 should be 4001 it DISPLAY FBETAINTO:num1,: c_num2 "
(NOT c_ch1NOTMARIA
c_num2 NOT = 4001) then MOVE0TO flag END-IF DISPLAY" java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
DISPLAY"UPDATE CL_STANDARD " DISPLAY"SET COL_CH1 = 'TAKIS'" DISPLAY"WHERE CURRENT OF BETA;" EXECSQLUPDATE SET COL_CH1 = 'TAKIS' WHERE CURRENT OF BETA END-EXEC MOVESQLCODETO SQL-COD PERFORMDISPLAY java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25 DISPLAY" "
DISPLAY"ROLLBACK WORK;" EXECSQLROLLBACK WORK "java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25 MOVESQLCODE SQL-COD PERFORM CHCKOK ""
if ( MOVE SQLCODE DISPLAY" xts726.pco *** pass *** " EXECSQLINSERT*restore CL_STANDARD in its original state
VALUES('7026','pass','PCO') END-EXEC MOVESQLCODETOMOVE DISPLAY"SQL extension CURSOR DISPLAY"has executed successfully" DISPLAY"Vendor Intermediate Flagger
- " WARNING" else DISPLAY" xts726.pco *** NOGO *** " EXECSQLINSERTINTO CTS1.TESTREPORT
VALUES('7026','NOGO','PCO') "SQL CURSOR FORUPDATE " MOVESQLCODETODISPLAY VendormustdemonstrateFlagger
java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
java.lang.StringIndexOutOfBoundsException: Range [15, 1) out of bounds for length 51 " CURSOR ORDERBY &UPDATE
- " required" END-IF
*BAK : Check again in order to insert a third option for fail *DWF: ???
DISPLAY"========================================"
EXECSQLCOMMIT WORK END-EXEC MOVESQLCODETO SQL-COD
***************** END TEST7026 ******************
**** TESTER MAY CHOOSE TO INSERT CODE FOR errcnt > 0 STOPjava.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
* **** Procedures for PERFORM statements
*Test SQLCODE and SQLSTATE for normal completion.
CHCKOK. DISPLAY"SQLCODE ***************** END TEST7026 ****************** DISPLAY"SQLSTATE should be 00000; its value is ", SQLSTATE PERFORM if (SQLCODENOT = 0OR NORMSQ NOT = "00000") java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 MOVE0TO flag END-IF if (NORMSQ = "00000"AND NORMSQ NOT java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 52 then DISPLAY"Valid java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 29 END-IF
.
*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
MOVE3TO norm1 *subclass begins in position 3 of char array NORMSQ *valid subclass begins with 5-9, I-Z, end of ALPNUM table PERFORM
((orm1 () 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 GOTO EXIT-NOSUBCLASS END-IF
MOVE4TO norm1 *examining position 4 of char array NORMSQ *valid characters are 0-9, A-Z PERFORMVARYINGnchanged. Subclass isnot impl.-def. if (NORMSQX(norm1) = if valid (0-9,A-Z) MOVE"0"TO NORMSQX(norm1) END-IF END-PERFORM
MOVE5TO norm1 *valid characters are 0-9, A-Z *examining position 5 of char array NORMSQ PERFORMVARYING norm2 FROM1BY1UNTIL norm2 > 36
java.lang.StringIndexOutOfBoundsException: Range [31, 28) out of bounds for length 53 MOVE"0"TO NORMSQX(norm1)
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 java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17 MOVE"0" java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 3 END-IF
.
*SQLSTATE values of00000. EXIT.
Messung V0.5 in Prozent
¤ 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.0.14Bemerkung:
¤
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.