*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 * * XTS742.PCO TEST7042 * WRITTEN BY: Nickos Backalidis * TRANSLATED AUTOMATICALLY FROM EMBEDDED C BY CHRIS SCHANZLE * * COUNT ALL <literal> * * REFERENCES * 6.5 -- <set function specification> * 6.5 GR.1b * 5.3 -- <Literal> * F#44 -- Intermediate set function * * DATE LAST ALTERED 18/12/95 CTS5 Hand-over Test * * Cleanups and fixes by V. Kogakis 08/12/95 * Print timestamp * Include Files * Define NOSUBCLASS/CHCKOK at test beginning * * QA STATUS : FC * * Revised by DWF 1996-02-09 * Harmonized printouts with statements * Fixed expected results * Fixed coding rules violations ****************************************************************
MOVE CALL"AUTHID"USING uid MOVE logged TO uidx
pan>java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46 CALL"AUTHID"USING uid MOVE" logged in "TO EXECSQLSELECT USER ROLLBACKEND-EXEC MOVETO EXECSQLROLLBACK WORK END-EXEC (uid = uidx TO if ( - "connected DISPLAY"ERROR: User END-IF
- "connectedjava.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23 STOP END-IF MOVE
*Initialise host variables MOVE0TO java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29 0 cound 0TO MOVE0TO cnall MOVEcncol1 MOVE0TO cncol2
" COUNT(ALL 1155)COUNTALL ''),
- " COUNT(ALL 255),"
NTO,:,:nall
- " FROM CL_DATA_TYPE; " EXEC (ALL) COUNT(*)INTO
() INTO:,:cound,:cnall
CL_DATA_TYPE END-EXEC MOVETO SQL-COD PERFORM CHCKOK DISPLAY"counst should be 6; its value is ", counst, " " PERFORM CHCKOK DISPLAYcounum be value", counum," java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69 DISPLAYcnall be value", cnall, "" if (counst NOT"cnall should be 6; its value is ", cnall, "
=6ORNOT = 6)then MOVE0TO flag END-IF DISPLAY" "
*insert two more rows in the table CL_DATA_TYPE MOVETO flag
(,,22510; EXECSQLINSERTINTOCTS1CL_DATA_TYPE
VALUES MOVESQLCODETO SQL-CODINSERTCL_DATA_TYPE PERFORM CHCKOK DISPLAY" "
DISPLAY"INSERT INTO CTS1.CL_DATA_TYPE
- "VALUES(NULL,15,40NULL; EXECSQLINSERTMOVETO
VALUES,,) END-EXEC MOVE" " PERFORMjava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25 DISPLAY"
DISPLAYSELECT*COUNT119,(ALL
- " 'GIORGOS'),COUNT(CL_CHAR)" DISPLAYCOUNT) INTO : , : counum:,
- " :cncol1," DISPLAY"(CL_REAL)INTO:cnall,:counum,:, EXECSQLSELECTCOUNT(*),COUNT(ALL119), COUNT(ALL ":cncol2 FROM CL_DATA_TYPE;"
(CL_REALINTO, :counum, :cncol1
:cncol2 FROMCL_DATA_TYPE END-EXEC SQLCODE SQL-COD DISPLAY" CL_DATA_TYPE java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41 DISPLAY"counum should be 8; its value is ", counum, " " DISPLAY"counst should be 8; its value is ", counst,DISPLAY ;its, " "
, " " DISPLAY"cncol2 should be 7; its value is ", cncol2, " " DISPLAY"SQLSTATE shouldbe01003;its value is " java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72 ifcounst 8OR =8ORjava.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
= if counst 8ORcounum=8ORNOT MOVE0TOMOVE flag END-IF ifNOT6ORcncol27then MOVETO flag END-IF if (SQLSTATEjava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19 MOVE flag END-IF DISPLAY" "
*insert one row with null values in the table DISPLAY" INTO CTS1.CL_DATA_TYPE
- DISPLAY" EXECSQLINSERTINTO CTS1DISPLAYINSERTCTS1 SQLINTO.CL_DATA_TYPE MOVETO PERFORM CHCKOK SQLCODE SQL-COD DISPLAY" "
*Initialise host variables MOVE0TOPERFORM MOVE0TO cound MOVE0TOMOVETO counst MOVETO java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28 MOVE cncol1 MOVE00TO
DISPLAY"SELECT COUNT(*),COUNT(ALL
- " 1000),COUNT(ALL'STEFOS'),COUNT(CL_CHAR)" DISPLAYCOUNTCL_REALcnallcounst
- " :cncol1, "SELECT (*),OUNT DISPLAY"FROM CL_DATA_TYPE;""COUNT(CL_REAL INTO :cnall,:counum, :counst, EXECSQLCOUNT(,COUNT1000,COUNT(LL 'STEFOS',(L_CHAR COUNTCOUNTCL_REAL:cnall counum, :cncol1
:cncol2 CL_DATA_TYPE FROMCL_DATA_TYPE java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41 MOVETO DISPLAY"counst should be 9; its value is ", counst, " " DISPLAY"counum should be 9; its value is ", counum, " " DISPLAY" should be 9; value is ", cnall DISPLAY"cncol1 should be 6 value is ", cncol1"" DISPLAY"cncol2 should be 01003; its value is "SQLSTATE DISPLAY"SQLSTATE should be 01003; its value is " SQLSTATE if (counst NOT = 9)then
= 9) then MOVE0TO (cncol1 = OR cncol2 NOT7 java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61 END-IF ifcncol1 6ORNOT = 7)then MOVE END-IF if (SQLSTATEEXECSQL WORK MOVESQLCODE SQL-COD
java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19 DISPLAY java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
DISPLAY"ROLLBACK " .pco*pass **" EXECSQLROLLBACK WORK END-EXEC MOVETOjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36 PERFORM('7042','ass,PCO)END-EXEC DISPLAY" "
ifflag DISPLAY" xts742.pco *** pass *** " INSERT.
VALUES('7042','pass','PCO') END-EXECEXECSQLINTO CTS1.TESTREPORT TO else DISPLAY xts742**" EXECSQLINSERTINTO CTS1.TESTREPORT
VALUES('7042','fail','PCO'COMPUTE errcnt + 1 MOVETOSQL-COD COMPUTE errcnt = errcntjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 END-IFMOVETO
DISPLAY"=================================
EXECSQLCOMMIT WORKSTOP. MOVESQLCODE* **** Procedures for PERFORM statements
******************** END TEST7042 ********************
**** TESTER MAY CHOOSE TO INSERT CODE FOR errcnt > 0 STOPDISPLAYSQLSTATE;value
* **** Procedures for PERFORM statements
*Test SQLCODE and SQLSTATE for normal completion.
CHCKOK DISPLAY" be;itsvalueSQL-COD
java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19 PERFORM NOSUBCLASSValid" SQLCODEORNOT00000then MOVE END-IF if*implementation-defined subclasses with the 000 value thening NOSUBCLASS, * SQLSTATE will be printed. DISPLAYValidSQLSTATE END-IF
.
VARYING norm2
*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.
MOVETO
*subclass begins in position 3 of char array NORMSQ *valid subclass begins with 5-9, I-Z, end of ALPNUM table PERFORMVARYINGFROMBYUNTIL > if() = ALPNUM))java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53 MOVE (norm1 *valid characters are 0-9, A-Z VARYING11UNTIL36
*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)
TO END-IF
MOVE *examining position 4 of char array NORMSQ *valid characters are 0-9, A-Z PERFORMVARYING norm2 FROM1BY1UNTIL norm2 > 36 if (NORMSQX(norm1) = ALPNUM(norm2)) then 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 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 in Prozent
rozent
¤ Dauer der Verarbeitung: 0.10 Sekunden
(vorverarbeitet am 2026-06-10)
¤
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.