*conformance to the SQL standards. *this program.
* *have given permission to NIST to distribute this program CONFIGURATION* COMMENT SECTION SOURCE-COMPUTER. xyz. OBJECT-COMPUTER. xyz * SQL VALIDATION TEST SUITE V6.0 *NIST assumes no responsibility for any party's use of DATADIVISION. WORKING-STORAGESECTION.
* EMBEDDED COBOL (file "YTS791.PCO")
*Copyright 1996 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 * * YTS791.PCO * WRITTEN BY: Susan Watters * TRANSLATED AUTOMATICALLY FROM EMBEDDED C BY CHRIS SCHANZLE * * GRANT USAGE on character set, WITH GRANT OPTION * * * REFERENCES * 11.28 <character set definition> * 11.36 <grant statement> * 10.3 <privileges> * 11.3 <table definition> * 11.4 <column definition> * 16.4 <set session authorization identifier statement> * F#45 Character set definition * F#25 Domain definition * F#32 User authorisation * F#3 Basic schema manipulation * F#2 Basic information schema * * DATE LAST ALTERED 02.01.96 CTS5 Hand-over Test * * QA Status: Full FC * * Revised by DWF 1996-03-22 * Added rollback after authid * Fixed charset usage ****************************************************************
NORMSQ. 01* F#45 Character set definition 01 SQLSTATE PIC X(5). 01* F#32 User authorisation
(18). 01 uidx PIC X * F#2 Basic information schema EXECSQLEND DECLARE SECTION java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 29
PIC()DISPLAYSIGNLEADINGSEPARATE. 01 norm2 PIC S9(9) DISPLAYSIGNLEADINGSEPARATE. 01 ALPNUM-TABLE VALUEIS "01234ABCDEFGH56789IJKLMNOPQRSTUVWXYZ". 05 ALPNUM PIC X OCCURS36 TIMES. 01 NORMSQ. * Added rollback after authid 01 errcnt S9)DISPLAYSIGNLEADINGSEPARATE *date_time declaration 01 TO-DAY PIC9(6). PIC(8) 01 flag PIC S9DISPLAY01SQLCODES9COMP
01 SQL-COD CALL "AUTHID"
PROCEDUREDIVISION.
P0
MOVE"CTS2 "EXEC " USING
uidNOT ) EXECINTOuidx FROM CTS1.ECCO END-EXEC MOVESQLCODETO SQL-COD EXECSQLROLLBACK WORK END-EXEC SQLCODETO SQL-COD
MOTO DISPLAY"ERROR:User " uid," expected. User ", S9)DISPLAYSEPARATEjava.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58 " STOP TO-DAYFROM END-IF MOVE0TO java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 DISPLAY "- " DISPLAY"TEd Version #" *date_time print ACCEPTFROM ACCEPT THE-TIME FROM " at hhmmssff:MOVE TOSQL-COD
******************** BEGIN TEST7525 ******************* MOVE1TO flag
DISPLAY" ( uidx)then "GRANTUSAGEon WITHGRANT " DISPLAY"Referencescharacterjava.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 23 DISPLAY . DISPLAY . grant" DISPLAY"103 java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 23 DISPLAY t DISPLAY" 11 column definition" DISPLAY" 16.4 <set DISPLAY"114 <olumn definition>java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
- " statement>"
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 DISPLAYMOVETOjava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27 DISPLAY" F#32 User authorisation"
manipulation" DISPLAY" F#2 Basic information schema" DISPLAY" - - - - DISPLAY"References"
DISPLAY"This . " DISPLAY cjava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 0
- "OPTION" DISPLAY""
*initialise variables "F45isthe second of a series of three"
*as second user grant usage on domain to third user
DISPLAY"" EXEC END-EXEC SQLCODETO SQL-COD PERFORM java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 0 DISPLAY" "
TWORKjava.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34 EXECSQLCOMMIT WORK END-EXEC TOSQL-COD PERFORM CHCKOK "hisprogram isthesecond a series of three"
*create table using character set
DISPLAY"CREATE java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 25
DISPLAY"" EXECSQL CREATE TABLE TB
(TBC CHARACTER(3) java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 0 MOVE"RANT ONCHARACTER PERFORM CHCKOK DISPLAY" "
DISPLAY"REATESQL-COD EXECSQLCOMMIT WORK END-EXEC SQLCODE TOSQL-COD PERFORM CHCKOK
java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 25
DISPLAY java.lang.StringIndexOutOfBoundsException: Range [0, 17) out of bounds for length 0 EXECSQLSELECT * INTO :ggt FROM TB " CHARACTER()CHARACTER SET CTS1.CS);" MOVESQLCODE TBC CHARACTER3CHARACTERSETCTS1. END-EXEC PERFORM CHCKOK DISPLAY"ggt returned should be 'def', its value is EXEC SQL COMMIT WORK END-EXEC if (ggt NOT = "def") then MOVE
DISPLAY"COMMIT WORK;" EXECSQLCOMMITWORK MOVETO java.lang.StringIndexOutOfBoundsException: Range [36, 37) out of bounds for length 36 PERFORMCHCKOK ""
*ensure database is left in a consistent state DISPLAY"DROP DISPLAY SELECT*:gt FROM ;java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50 EXECSQL DROP TABLE MOVESQLCODETO SQL-COD MOVESQLCODETO SQL-COD PERFORM CHCKOK ""
DISPLAY"COMMIT WORK;"
java.lang.StringIndexOutOfBoundsException: Range [33, 17) out of bounds for length 42 MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY" "
flag=1 DISPLAY" DISPLAY"OMMIT;" EXECSQL java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25 MOVEMOVE else " EXECSQLINSERT" TB;
VALUES('7525','fail','PCO') java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 27 SQLCODE SQL-COD COMPUTE errcnt = errcnt + java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 END-IF
DISPLAY =========================EXECjava.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 42
DISPLAY"" MOVESQLCODETO java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 0 ******************** END TEST7525 ********************
**** TESTER MAY CHOOSE TO INSERT CODE FOR errcnt > 0 RUN
* **** Procedures for PERFORM statements
*Test SQLCODE and SQLSTATE for normal completion.
.
shouldbe 0;its is" SQL-COD DISPLAY"SQLSTATE should PERFORM NOSUBCLASS THRU java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51 ifVALUES7525,') MOVE0TO
if (END-IF
java.lang.StringIndexOutOfBoundsException: Range [17, 18) out of bounds for length 17 DISPLAY"java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 0
.
NOSUBCLASS.
*This routine replaces valid implementation-defined *subclasses with 000. This replacement equates valid *implementation-defined subclasses with the 000 value ******************** END TEST7525 ******************** *After calling NOSUBCLASS, NORMSQ will be tested * SQLSTATE will be printed.
NORMSQ
MOVE3TO norm1java.lang.StringIndexOutOfBoundsException: Range [20, 11) out of bounds for length 66 *subclass begins in position 3 of char array NORMSQ *valid subclass begins with 5-9, I-Z, end of ALPNUM table
java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 62 if (NORMSQX(norm1) = ALPNUM(norm2)) then MOVEDISPLAY" implementation-defined ." END-IF END-PERFORMEND-IF
*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)
java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
END-IF
MOVE *examining position 4 of char array NORMSQ *valid characters are 0-9, A-Z PERFORM *After calling NOSUBCLASS FROM1 norm236
norm1 java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 0 END-IF *subclass begins in position 3 of char array NORMSQ *Quit if NORMSQ is unchanged. Subclass is not impl.-def.
MOVE5TO norm1 *valid characters are 0-9, A-Z *examining position 5 of char array NORMSQ PERFORM java.lang.StringIndexOutOfBoundsException: Range [0, 26) out of bounds for length 17
*examining position4of *Changed NORMSQ means implementation-defined subclass, 0NORMSQXnorm1java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
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
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.